Commit a9d1268e authored by Yoni Fogel's avatar Yoni Fogel

Closes #1680 Moved assertion that cachefile is not in a checkpoint to when a...

Closes #1680 Moved assertion that cachefile is not in a checkpoint to when a cachefile actually closes
instead of just reducing reference count.

git-svn-id: file:///svn/toku/tokudb@11268 c7de825b-a66e-492c-adef-691d508d4ae1
parent ee259881
...@@ -394,11 +394,12 @@ int toku_cachefile_close (CACHEFILE *cfp, TOKULOGGER logger, char **error_string ...@@ -394,11 +394,12 @@ int toku_cachefile_close (CACHEFILE *cfp, TOKULOGGER logger, char **error_string
CACHEFILE cf = *cfp; CACHEFILE cf = *cfp;
CACHETABLE ct = cf->cachetable; CACHETABLE ct = cf->cachetable;
cachetable_lock(ct); cachetable_lock(ct);
assert(!cf->next_in_checkpoint);
assert(!cf->for_checkpoint);
assert(cf->refcount>0); assert(cf->refcount>0);
cf->refcount--; cf->refcount--;
if (cf->refcount==0) { if (cf->refcount==0) {
//Checkpoint holds a reference, close should be impossible if still in use by a checkpoint.
assert(!cf->next_in_checkpoint);
assert(!cf->for_checkpoint);
int r; int r;
if ((r = cachetable_flush_cachefile(ct, cf))) { if ((r = cachetable_flush_cachefile(ct, cf))) {
error: error:
......
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