mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 03:51:50 +01:00
test_abort1.tdb runs. Addresses #253.
git-svn-id: file:///svn/tokudb@1621 c7de825b-a66e-492c-adef-691d508d4ae1
This commit is contained in:
parent
4e3af7f169
commit
ae00985a15
2 changed files with 30 additions and 4 deletions
|
@ -1582,7 +1582,7 @@ int toku_pma_clear_at_index (PMA pma, unsigned int idx) {
|
|||
if (!kv_pair_inuse(pma->pairs[idx])) return -1;
|
||||
pma_mfree_kv_pair(pma, pma->pairs[idx]);
|
||||
pma->pairs[idx]=0;
|
||||
pma->n_pairs_present++;
|
||||
pma->n_pairs_present--;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -109,6 +109,20 @@ void toku_recover_fcreate (struct logtype_fcreate *c) {
|
|||
toku_free(c->fname.data);
|
||||
}
|
||||
|
||||
int toku_rollback_fcreate (struct logtype_fcreate *le, TOKUTXN txn __attribute__((__unused__))) {
|
||||
char *fname = fixup_fname(&le->fname);
|
||||
char *directory = txn->logger->directory;
|
||||
int full_len=strlen(fname)+strlen(directory)+2;
|
||||
char full_fname[full_len];
|
||||
int l = snprintf(full_fname,full_len, "%s/%s", directory, fname);
|
||||
assert(l<=full_len);
|
||||
int r = unlink(full_fname);
|
||||
assert(r==0);
|
||||
toku_free(fname);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void toku_recover_fheader (struct logtype_fheader *c) {
|
||||
struct cf_pair *pair;
|
||||
int r = find_cachefile(c->filenum, &pair);
|
||||
|
@ -178,6 +192,16 @@ void toku_recover_newbrtnode (struct logtype_newbrtnode *c) {
|
|||
assert(r==0);
|
||||
}
|
||||
|
||||
int toku_rollback_newbrtnode (struct logtype_newbrtnode *le, TOKUTXN txn) {
|
||||
// All that must be done is to put the node on the freelist.
|
||||
// Since we don't have a freelist right now, we don't have anything to do.
|
||||
// We'll fix this later (See #264)
|
||||
le=le;
|
||||
txn=txn;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
void toku_recover_fopen (struct logtype_fopen *c) {
|
||||
char *fname = fixup_fname(&c->fname);
|
||||
CACHEFILE cf;
|
||||
|
@ -190,6 +214,11 @@ void toku_recover_fopen (struct logtype_fopen *c) {
|
|||
toku_free(c->fname.data);
|
||||
}
|
||||
|
||||
int toku_rollback_fopen (struct logtype_fopen *le __attribute__((__unused__)), TOKUTXN txn __attribute__((__unused__))) {
|
||||
// Nothing needs to be done to undo an fopen.
|
||||
return 0;
|
||||
}
|
||||
|
||||
void toku_recover_insertinleaf (struct logtype_insertinleaf *c) {
|
||||
struct cf_pair *pair;
|
||||
int r = find_cachefile(c->filenum, &pair);
|
||||
|
@ -282,9 +311,6 @@ void toku_recover_pmadistribute (struct logtype_pmadistribute *c) {
|
|||
toku_free(c->fromto.array);
|
||||
}
|
||||
|
||||
int toku_rollback_fcreate (struct logtype_fcreate *le, TOKUTXN txn) ABORTIT
|
||||
int toku_rollback_fheader (struct logtype_fheader *le, TOKUTXN txn) ABORTIT
|
||||
int toku_rollback_newbrtnode (struct logtype_newbrtnode *le, TOKUTXN txn) ABORTIT
|
||||
int toku_rollback_fopen (struct logtype_fopen *le, TOKUTXN txn) ABORTIT
|
||||
int toku_rollback_resizepma (struct logtype_resizepma *le, TOKUTXN txn) ABORTIT
|
||||
int toku_rollback_pmadistribute (struct logtype_pmadistribute *le, TOKUTXN txn) ABORTIT
|
||||
|
|
Loading…
Add table
Reference in a new issue