Skip to content

Commit

Permalink
mremap the data file after each write. Naive approach for now until #2
Browse files Browse the repository at this point in the history
…is implemented
  • Loading branch information
Shelnutt2 committed Jul 20, 2017
1 parent 9f7df84 commit 5ed234d
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/crunch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,12 @@ int crunch::write_row(uchar *buf) {
//Write message to file
capnp::writeMessageToFd(dataFileDescriptor, tableRow);

// mremap the datafile since it's grown. This is a naive approach, ideally we'd like to do this from a fswatch thread and after a transaction completes
if(!mremapData()) {
std::cerr << "Could not mremap data file after writing row" << std::endl;
DBUG_RETURN(-1);
}

// Reset bitmap to original
dbug_tmp_restore_column_map(table->read_set, old_map);
DBUG_RETURN(0);
Expand Down

0 comments on commit 5ed234d

Please sign in to comment.