Commit c4b286af authored by John Esmet's avatar John Esmet Committed by Yoni Fogel

refs #5179 improve comment for get_next_ule that fixed hot indexing but, and...

refs #5179 improve comment for get_next_ule that fixed hot indexing but, and document the client contract regarding hot db writes and index create/abort/close


git-svn-id: file:///svn/toku/tokudb@45190 c7de825b-a66e-492c-adef-691d508d4ae1
parent c38ff36d
...@@ -410,7 +410,8 @@ build_index(DB_INDEXER *indexer) { ...@@ -410,7 +410,8 @@ build_index(DB_INDEXER *indexer) {
// grab the next leaf entry and get its provisional info. we'll // grab the next leaf entry and get its provisional info. we'll
// need the provisional info for the undo-do algorithm, and we get // need the provisional info for the undo-do algorithm, and we get
// it here so it can be read atomically with respect to txn commit // it here so it can be read atomically with respect to txn commit
// and abort. // and abort. the atomicity comes from the root-to-leaf path pinned
// by the query and in the getf callback function
// //
// this allocates space for the prov info, so we have to destroy it // this allocates space for the prov info, so we have to destroy it
// when we're done. // when we're done.
...@@ -471,6 +472,7 @@ build_index(DB_INDEXER *indexer) { ...@@ -471,6 +472,7 @@ build_index(DB_INDEXER *indexer) {
return result; return result;
} }
// Clients must not operate on any of the hot dbs concurrently with close
static int static int
close_indexer(DB_INDEXER *indexer) { close_indexer(DB_INDEXER *indexer) {
int r = 0; int r = 0;
...@@ -498,6 +500,7 @@ close_indexer(DB_INDEXER *indexer) { ...@@ -498,6 +500,7 @@ close_indexer(DB_INDEXER *indexer) {
return r; return r;
} }
// Clients must not operate on any of the hot dbs concurrently with abort
static int static int
abort_indexer(DB_INDEXER *indexer) { abort_indexer(DB_INDEXER *indexer) {
(void) __sync_fetch_and_sub(&STATUS_VALUE(INDEXER_CURRENT), 1); (void) __sync_fetch_and_sub(&STATUS_VALUE(INDEXER_CURRENT), 1);
......
...@@ -43,6 +43,8 @@ void toku_indexer_unlock(DB_INDEXER* indexer); ...@@ -43,6 +43,8 @@ void toku_indexer_unlock(DB_INDEXER* indexer);
// //
// Returns 0 if the indexer has been created and sets *indexer to the indexer object. // Returns 0 if the indexer has been created and sets *indexer to the indexer object.
// If an error occurred while creating the indexer object, a non-zero error number is returned. // If an error occurred while creating the indexer object, a non-zero error number is returned.
//
// Clients must not operate on any of the dest_dbs concurrently with create_indexer();
int toku_indexer_create_indexer(DB_ENV *env, int toku_indexer_create_indexer(DB_ENV *env,
DB_TXN *txn, DB_TXN *txn,
DB_INDEXER **indexer, DB_INDEXER **indexer,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment