Commit 782e3459 authored by Zardosht Kasheff's avatar Zardosht Kasheff Committed by Yoni Fogel
Browse files

[t:4512], remove brt_header->checkpoint_before_commit_link and...

[t:4512], remove brt_header->checkpoint_before_commit_link and txn->checkpoint_before_commit, and replace it with a BOOL that states if a checkpoint is needed or not

git-svn-id: file:///svn/toku/tokudb@42758 c7de825b-a66e-492c-adef-691d508d4ae1
parent cc10b7c7
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -390,7 +390,6 @@ struct brt_header {
    TXNID root_xid_that_created;
    struct toku_list live_brts;
    struct toku_list zombie_brts;
    struct toku_list checkpoint_before_commit_link;

    brt_compare_func compare_fun;
    brt_update_func update_fun;
+0 −1
Original line number Diff line number Diff line
@@ -2893,7 +2893,6 @@ deserialize_brtheader_versioned(int fd, struct rbuf *rb, struct brt_header **brt
    h->panic_string = 0;
    toku_list_init(&h->live_brts);
    toku_list_init(&h->zombie_brts);
    toku_list_init(&h->checkpoint_before_commit_link);

    //version MUST be in network order on disk regardless of disk order
    h->layout_version_read_from_disk = rbuf_network_int(rb);
+1 −14
Original line number Diff line number Diff line
@@ -3352,7 +3352,6 @@ brt_init_header (BRT t, TOKUTXN txn) {

    toku_list_init(&t->h->live_brts);
    toku_list_init(&t->h->zombie_brts);
    toku_list_init(&t->h->checkpoint_before_commit_link);
    int r = brt_init_header_partial(t, txn);
    if (r==0) toku_block_verify_no_free_blocknums(t->h->blocktable);
    return r;
@@ -6534,25 +6533,13 @@ int toku_brt_destroy(void) {
    return r;
}


// Require that dictionary specified by brt is fully written to disk before
// transaction txn is committed.
void
toku_brt_require_local_checkpoint (BRT brt, TOKUTXN txn) {
    toku_brtheader_lock(brt->h);
    toku_list_push(&txn->checkpoint_before_commit,
		   &brt->h->checkpoint_before_commit_link);
    toku_brtheader_unlock(brt->h);
}


//Suppress both rollback and recovery logs.
void
toku_brt_suppress_recovery_logs (BRT brt, TOKUTXN txn) {
    assert(brt->h->txnid_that_created_or_locked_when_empty == toku_txn_get_txnid(txn));
    assert(brt->h->txnid_that_suppressed_recovery_logs	   == TXNID_NONE);
    brt->h->txnid_that_suppressed_recovery_logs		   = toku_txn_get_txnid(txn);
    toku_list_push(&txn->checkpoint_before_commit, &brt->h->checkpoint_before_commit_link);
    txn->checkpoint_needed_before_commit = TRUE;
}

BOOL
+1 −1
Original line number Diff line number Diff line
@@ -176,7 +176,7 @@ struct tokutxn {
    uint32_t   current_rollback_hash;

    BOOL       recovered_from_checkpoint;
    struct toku_list checkpoint_before_commit;
    BOOL checkpoint_needed_before_commit;
    TXN_IGNORE_S ignore_errors; // 2954
    TOKUTXN_STATE state;
    LSN        do_fsync_lsn;
+2 −8
Original line number Diff line number Diff line
@@ -456,9 +456,8 @@ int toku_rollback_commit(TOKUTXN txn, YIELDF yield, void*yieldv, LSN lsn) {
        assert(r==0);

        // Merge the list of headers that must be checkpointed before commit
        while (!toku_list_empty(&txn->checkpoint_before_commit)) {
            struct toku_list *list = toku_list_pop(&txn->checkpoint_before_commit);
            toku_list_push(&txn->parent->checkpoint_before_commit, list);
        if (txn->checkpoint_needed_before_commit) {
            txn->parent->checkpoint_needed_before_commit = TRUE;
        }

        //If this transaction needs an fsync (if it commits)
@@ -475,11 +474,6 @@ int toku_rollback_commit(TOKUTXN txn, YIELDF yield, void*yieldv, LSN lsn) {

int toku_rollback_abort(TOKUTXN txn, YIELDF yield, void*yieldv, LSN lsn) {
    int r;
    //Empty the list
    while (!toku_list_empty(&txn->checkpoint_before_commit)) {
        toku_list_pop(&txn->checkpoint_before_commit);
    }

    r = apply_txn(txn, yield, yieldv, lsn, toku_abort_rollback_item);
    assert(r==0);
    return r;
Loading