diff --git a/src/couch_db.cc b/src/couch_db.cc index 623d0a7..b6907b5 100644 --- a/src/couch_db.cc +++ b/src/couch_db.cc @@ -186,6 +186,7 @@ couchstore_error_t couchstore_commit(Db *db) if (db->header.local_docs_root) { localrootsize = 12 + db->header.local_docs_root->reduce_value.size; } + db->file.pos += db->file.pos % COUCH_BLOCK_SIZE == 0 ? 0 : COUCH_BLOCK_SIZE - (db->file.pos % COUCH_BLOCK_SIZE); db->file.pos += 25 + seqrootsize + idrootsize + localrootsize; //Extend file size to where end of header will land before we do first sync db_write_buf(&db->file, &zerobyte, NULL, NULL);