mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 03:51:50 +01:00
Note that svn seems to be putting a lot of bookkeeping info in {{{svn:mergeinfo}}}, but it seems harmless. {{{ svn merge -r10281:10294 https://svn.tokutek.com/tokudb/toku/tokudb.1472 }}} git-svn-id: file:///svn/toku/tokudb@10296 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
302f13a2a6
commit
28e6ad3ecc
3 changed files with 14 additions and 7 deletions
|
@ -486,3 +486,4 @@ int main (int argc, const char *argv[]) {
|
|||
|
||||
return 0;
|
||||
}
|
||||
b
|
||||
|
|
|
@ -3040,7 +3040,9 @@ int toku_close_brt (BRT brt, TOKULOGGER logger, char **error_string) {
|
|||
assert(0==toku_cachefile_count_pinned(brt->cf, 1)); // For the brt, the pinned count should be zero (but if panic, don't worry)
|
||||
//printf("%s:%d closing cachetable\n", __FILE__, __LINE__);
|
||||
// printf("%s:%d brt=%p ,brt->h=%p\n", __FILE__, __LINE__, brt, brt->h);
|
||||
assert(*error_string == 0);
|
||||
r = toku_cachefile_close(&brt->cf, logger, error_string);
|
||||
if (r==0) assert(*error_string == 0);
|
||||
}
|
||||
if (brt->database_name) toku_free(brt->database_name);
|
||||
if (brt->fname) toku_free(brt->fname);
|
||||
|
|
|
@ -344,18 +344,22 @@ int toku_cachefile_close (CACHEFILE *cfp, TOKULOGGER logger, char **error_string
|
|||
int r;
|
||||
if ((r = cachetable_flush_cachefile(ct, cf))) {
|
||||
//This is not a graceful shutdown; do not set file as clean.
|
||||
cachetable_unlock(ct);
|
||||
return r;
|
||||
}
|
||||
if (cf->close_userdata && (r = cf->close_userdata(cf, cf->userdata, error_string))) {
|
||||
//This is not a graceful shutdown; do not set file as clean.
|
||||
not_graceful_shutdown:
|
||||
cf->cachetable->cachefiles = remove_cf_from_list(cf, cf->cachetable->cachefiles);
|
||||
if (cf->fname) toku_free(cf->fname);
|
||||
int r2 = close(cf->fd);
|
||||
if (r2!=0) fprintf(stderr, "%s:%d During error handling, could not close file r=%d errno=%d\n", __FILE__, __LINE__, r2, errno);
|
||||
//assert(r == 0);
|
||||
toku_free(cf);
|
||||
cachetable_unlock(ct);
|
||||
return r;
|
||||
}
|
||||
if (cf->close_userdata && (r = cf->close_userdata(cf, cf->userdata, error_string))) {
|
||||
goto not_graceful_shutdown;
|
||||
}
|
||||
//Graceful shutdown. 'clean' the file.
|
||||
if ((r = toku_graceful_close(cf))) {
|
||||
cachetable_unlock(ct);
|
||||
return r;
|
||||
goto not_graceful_shutdown;
|
||||
}
|
||||
cf->close_userdata = NULL;
|
||||
cf->checkpoint_userdata = NULL;
|
||||
|
|
Loading…
Add table
Reference in a new issue