Loading buildheader/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -22,4 +22,4 @@ default: ../include/db.h hfiles: tdb.h clean: rm -f *.o make_tdb make_db_h_?_? sample_offsets sample_offsets_mysql make_tdb_h rm -f *.o make_tdb db-benchmark-test/db-benchmark-test.c +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ enum { DEFAULT_ITEMS_PER_TRANSACTION = 1<<14 }; #define DEFAULT_N_ITERATIONS (DEFAULT_N_ITEMS/DEFAULT_ITEMS_TO_INSERT_PER_ITERATION) static void insert (long long v); #define CKERR(r) do { if (r!=0) fprintf(stderr, "%s:%d error %d %s\n", __FILE__, __LINE__, r, db_strerror(r)); assert(r==0); } while (0) #define CKERR(r) ({ int __r = r; if (__r!=0) fprintf(stderr, "%s:%d error %d %s\n", __FILE__, __LINE__, __r, db_strerror(r)); assert(__r==0); }) #define CKERR2(r,rexpect) do { if (r!=rexpect) fprintf(stderr, "%s:%d error %d %s\n", __FILE__, __LINE__, r, db_strerror(r)); assert(r==rexpect); } while (0) /* default test parameters */ Loading newbrt/brt-internal.h +1 −1 Original line number Diff line number Diff line Loading @@ -433,7 +433,7 @@ struct brt { int pinned_by_checkpoint; //Keep this brt around for checkpoint, like a transaction int was_closed; //True when this brt was closed, but is being kept around for transactions (or checkpoint). int (*close_db)(DB*, u_int32_t); int (*close_db)(DB*, u_int32_t, bool oplsn_valid, LSN oplsn); u_int32_t close_flags; struct toku_list live_brt_link; Loading newbrt/brt.c +9 −8 Original line number Diff line number Diff line Loading @@ -3806,10 +3806,10 @@ brt_redirect_db (BRT brt_to, BRT brt_from) { } static int fake_db_brt_close_delayed(DB *db, u_int32_t UU(flags)) { fake_db_brt_close_delayed(DB *db, u_int32_t UU(flags), bool oplsn_valid, LSN oplsn) { BRT brt_to_close = db->api_internal; char *error_string = NULL; int r = toku_close_brt(brt_to_close, &error_string); int r = toku_close_brt_lsn(brt_to_close, &error_string, oplsn_valid, oplsn); assert_zero(r); assert(error_string == NULL); toku_free(db); Loading Loading @@ -3841,7 +3841,7 @@ toku_brt_header_close_redirected_brts(struct brt_header * h) { assert(which == num_brts); for (which = 0; which < num_brts; which++) { int r; r = toku_brt_db_delay_closed(brts[which], dbs[which], fake_db_brt_close_delayed, 0); r = toku_brt_db_delay_closed(brts[which], dbs[which], fake_db_brt_close_delayed, 0, false, ZERO_LSN); assert_zero(r); } return 0; Loading Loading @@ -4198,7 +4198,7 @@ brtheader_note_unpin_by_checkpoint (CACHEFILE UU(cachefile), void *header_v) if (brt_to_unpin->was_closed && !toku_brt_zombie_needed(brt_to_unpin)) { //Close immediately. assert(brt_to_unpin->close_db); r = brt_to_unpin->close_db(brt_to_unpin->db, brt_to_unpin->close_flags); r = brt_to_unpin->close_db(brt_to_unpin->db, brt_to_unpin->close_flags, false, ZERO_LSN); } return r; Loading Loading @@ -4351,8 +4351,9 @@ toku_brtheader_close (CACHEFILE cachefile, int fd, void *header_v, char **malloc } int toku_brt_db_delay_closed (BRT zombie, DB* db, int (*close_db)(DB*, u_int32_t), u_int32_t close_flags) { //Requires: close_db needs to call toku_close_brt to delete the final reference. toku_brt_db_delay_closed (BRT zombie, DB* db, int (*close_db)(DB*, u_int32_t, bool oplsn_valid, LSN oplsn), u_int32_t close_flags, bool oplsn_valid, LSN oplsn) // Effect: See brt.h for the specification of this function. { int r; struct brt_header *h = zombie->h; if (zombie->was_closed) r = EINVAL; Loading @@ -4365,7 +4366,7 @@ toku_brt_db_delay_closed (BRT zombie, DB* db, int (*close_db)(DB*, u_int32_t), u if (!zombie->db) zombie->db = db; if (!toku_brt_zombie_needed(zombie)) { //Close immediately. r = zombie->close_db(zombie->db, zombie->close_flags); r = zombie->close_db(zombie->db, zombie->close_flags, oplsn_valid, oplsn); } else { //Try to pass responsibility off. Loading Loading @@ -4423,7 +4424,7 @@ int toku_close_brt_lsn (BRT brt, char **error_string, BOOL oplsn_valid, LSN opls return r; } int toku_close_brt (BRT brt, char **error_string) { int toku_close_brt_nolsn (BRT brt, char **error_string) { return toku_close_brt_lsn(brt, error_string, FALSE, ZERO_LSN); } Loading newbrt/brt.h +6 −2 Original line number Diff line number Diff line Loading @@ -151,8 +151,12 @@ int toku_brt_send_insert(BRT brt, DBT *key, DBT *val, XIDS xids, enum brt_msg_ty int toku_brt_send_delete(BRT brt, DBT *key, XIDS xids) __attribute__ ((warn_unused_result)); int toku_brt_send_commit_any(BRT brt, DBT *key, XIDS xids) __attribute__ ((warn_unused_result)); int toku_brt_db_delay_closed (BRT brt, DB* db, int (*close_db)(DB*, u_int32_t), u_int32_t close_flags) __attribute__ ((warn_unused_result)); int toku_close_brt (BRT, char **error_string) __attribute__ ((warn_unused_result)); int toku_brt_db_delay_closed (BRT brt, DB* db, int (*close_db)(DB*, u_int32_t, bool oplsn_valid, LSN oplsn), u_int32_t close_flags, bool oplsn_valid, LSN oplsn) __attribute__ ((warn_unused_result)); // Effect: Arrange to really (eventually) close a zombie DB. When it is closed the CLOSE_DB function will be alled. // Requires: close_db needs to call toku_close_brt to delete the final reference. int toku_close_brt_nolsn (BRT, char **error_string) __attribute__ ((warn_unused_result)); int toku_close_brt_lsn (BRT brt, char **error_string, BOOL oplsn_valid, LSN oplsn) __attribute__ ((warn_unused_result)); int toku_brt_set_panic(BRT brt, int panic, char *panic_string) __attribute__ ((warn_unused_result)); Loading Loading
buildheader/Makefile +1 −1 Original line number Diff line number Diff line Loading @@ -22,4 +22,4 @@ default: ../include/db.h hfiles: tdb.h clean: rm -f *.o make_tdb make_db_h_?_? sample_offsets sample_offsets_mysql make_tdb_h rm -f *.o make_tdb
db-benchmark-test/db-benchmark-test.c +1 −1 Original line number Diff line number Diff line Loading @@ -33,7 +33,7 @@ enum { DEFAULT_ITEMS_PER_TRANSACTION = 1<<14 }; #define DEFAULT_N_ITERATIONS (DEFAULT_N_ITEMS/DEFAULT_ITEMS_TO_INSERT_PER_ITERATION) static void insert (long long v); #define CKERR(r) do { if (r!=0) fprintf(stderr, "%s:%d error %d %s\n", __FILE__, __LINE__, r, db_strerror(r)); assert(r==0); } while (0) #define CKERR(r) ({ int __r = r; if (__r!=0) fprintf(stderr, "%s:%d error %d %s\n", __FILE__, __LINE__, __r, db_strerror(r)); assert(__r==0); }) #define CKERR2(r,rexpect) do { if (r!=rexpect) fprintf(stderr, "%s:%d error %d %s\n", __FILE__, __LINE__, r, db_strerror(r)); assert(r==rexpect); } while (0) /* default test parameters */ Loading
newbrt/brt-internal.h +1 −1 Original line number Diff line number Diff line Loading @@ -433,7 +433,7 @@ struct brt { int pinned_by_checkpoint; //Keep this brt around for checkpoint, like a transaction int was_closed; //True when this brt was closed, but is being kept around for transactions (or checkpoint). int (*close_db)(DB*, u_int32_t); int (*close_db)(DB*, u_int32_t, bool oplsn_valid, LSN oplsn); u_int32_t close_flags; struct toku_list live_brt_link; Loading
newbrt/brt.c +9 −8 Original line number Diff line number Diff line Loading @@ -3806,10 +3806,10 @@ brt_redirect_db (BRT brt_to, BRT brt_from) { } static int fake_db_brt_close_delayed(DB *db, u_int32_t UU(flags)) { fake_db_brt_close_delayed(DB *db, u_int32_t UU(flags), bool oplsn_valid, LSN oplsn) { BRT brt_to_close = db->api_internal; char *error_string = NULL; int r = toku_close_brt(brt_to_close, &error_string); int r = toku_close_brt_lsn(brt_to_close, &error_string, oplsn_valid, oplsn); assert_zero(r); assert(error_string == NULL); toku_free(db); Loading Loading @@ -3841,7 +3841,7 @@ toku_brt_header_close_redirected_brts(struct brt_header * h) { assert(which == num_brts); for (which = 0; which < num_brts; which++) { int r; r = toku_brt_db_delay_closed(brts[which], dbs[which], fake_db_brt_close_delayed, 0); r = toku_brt_db_delay_closed(brts[which], dbs[which], fake_db_brt_close_delayed, 0, false, ZERO_LSN); assert_zero(r); } return 0; Loading Loading @@ -4198,7 +4198,7 @@ brtheader_note_unpin_by_checkpoint (CACHEFILE UU(cachefile), void *header_v) if (brt_to_unpin->was_closed && !toku_brt_zombie_needed(brt_to_unpin)) { //Close immediately. assert(brt_to_unpin->close_db); r = brt_to_unpin->close_db(brt_to_unpin->db, brt_to_unpin->close_flags); r = brt_to_unpin->close_db(brt_to_unpin->db, brt_to_unpin->close_flags, false, ZERO_LSN); } return r; Loading Loading @@ -4351,8 +4351,9 @@ toku_brtheader_close (CACHEFILE cachefile, int fd, void *header_v, char **malloc } int toku_brt_db_delay_closed (BRT zombie, DB* db, int (*close_db)(DB*, u_int32_t), u_int32_t close_flags) { //Requires: close_db needs to call toku_close_brt to delete the final reference. toku_brt_db_delay_closed (BRT zombie, DB* db, int (*close_db)(DB*, u_int32_t, bool oplsn_valid, LSN oplsn), u_int32_t close_flags, bool oplsn_valid, LSN oplsn) // Effect: See brt.h for the specification of this function. { int r; struct brt_header *h = zombie->h; if (zombie->was_closed) r = EINVAL; Loading @@ -4365,7 +4366,7 @@ toku_brt_db_delay_closed (BRT zombie, DB* db, int (*close_db)(DB*, u_int32_t), u if (!zombie->db) zombie->db = db; if (!toku_brt_zombie_needed(zombie)) { //Close immediately. r = zombie->close_db(zombie->db, zombie->close_flags); r = zombie->close_db(zombie->db, zombie->close_flags, oplsn_valid, oplsn); } else { //Try to pass responsibility off. Loading Loading @@ -4423,7 +4424,7 @@ int toku_close_brt_lsn (BRT brt, char **error_string, BOOL oplsn_valid, LSN opls return r; } int toku_close_brt (BRT brt, char **error_string) { int toku_close_brt_nolsn (BRT brt, char **error_string) { return toku_close_brt_lsn(brt, error_string, FALSE, ZERO_LSN); } Loading
newbrt/brt.h +6 −2 Original line number Diff line number Diff line Loading @@ -151,8 +151,12 @@ int toku_brt_send_insert(BRT brt, DBT *key, DBT *val, XIDS xids, enum brt_msg_ty int toku_brt_send_delete(BRT brt, DBT *key, XIDS xids) __attribute__ ((warn_unused_result)); int toku_brt_send_commit_any(BRT brt, DBT *key, XIDS xids) __attribute__ ((warn_unused_result)); int toku_brt_db_delay_closed (BRT brt, DB* db, int (*close_db)(DB*, u_int32_t), u_int32_t close_flags) __attribute__ ((warn_unused_result)); int toku_close_brt (BRT, char **error_string) __attribute__ ((warn_unused_result)); int toku_brt_db_delay_closed (BRT brt, DB* db, int (*close_db)(DB*, u_int32_t, bool oplsn_valid, LSN oplsn), u_int32_t close_flags, bool oplsn_valid, LSN oplsn) __attribute__ ((warn_unused_result)); // Effect: Arrange to really (eventually) close a zombie DB. When it is closed the CLOSE_DB function will be alled. // Requires: close_db needs to call toku_close_brt to delete the final reference. int toku_close_brt_nolsn (BRT, char **error_string) __attribute__ ((warn_unused_result)); int toku_close_brt_lsn (BRT brt, char **error_string, BOOL oplsn_valid, LSN oplsn) __attribute__ ((warn_unused_result)); int toku_brt_set_panic(BRT brt, int panic, char *panic_string) __attribute__ ((warn_unused_result)); Loading