Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions src/ctrip_swap_iter.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,9 +290,6 @@ rocksIter *rocksCreateIter(rocks *rocks, redisDb *db) {
rocksdb_options_t* cf_opts[CF_COUNT], *db_opts;
db_opts = rocksdb_options_create_copy(rocks->db_opts);
rocksdb_options_set_db_log_dir(db_opts, "");
/* disable background jobs since child have no background threads */
rocksdb_options_set_max_background_jobs(db_opts, 0);
rocksdb_options_set_max_background_compactions(db_opts, 0);
for (i = 0; i < CF_COUNT; i++) {
/* disable cf cache since cache is useless for iterator */
cf_opts[i] = rocksdb_options_create_copy(rocks->cf_opts[i]);
Expand All @@ -303,10 +300,12 @@ rocksIter *rocksCreateIter(rocks *rocks, redisDb *db) {
}

char *errs[CF_COUNT] = {NULL};
rocksdb_t* checkpoint_db = rocksdb_open_column_families(db_opts,
/* Open checkpoint read-only so child iteration never schedules bg work to
avoid potential rocksdb hanging. */
rocksdb_t* checkpoint_db = rocksdb_open_for_read_only_column_families(db_opts,
server.rocksdb_rdb_checkpoint_dir, CF_COUNT, swap_cf_names,
(const rocksdb_options_t *const *)cf_opts,
it->cf_handles, errs);
it->cf_handles, 0, errs);
for (i = 0; i < CF_COUNT; i++) rocksdb_options_destroy(cf_opts[i]);
rocksdb_options_destroy(db_opts);

Expand Down Expand Up @@ -691,4 +690,3 @@ int swapIterTest(int argc, char *argv[], int accurate) {


#endif

Loading