Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix write global seqno #1563

Merged
merged 3 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions src/server/config.ini
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ stateful = true
rocksdb_block_cache_capacity = 10737418240
rocksdb_block_cache_num_shard_bits = -1
rocksdb_disable_bloom_filter = false
rocksdb_write_global_seqno = false
# Bloom filter type, should be either 'common' or 'prefix'
rocksdb_filter_type = prefix
# rocksdb_bloom_filter_bits_per_key | false positive rate
Expand Down
7 changes: 7 additions & 0 deletions src/server/rocksdb_wrapper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,12 @@ DSN_DEFINE_int32(pegasus.server,
0,
"Which error code to inject in write path, 0 means no error. Only for test.");
DSN_TAG_VARIABLE(inject_write_error_for_test, FT_MUTABLE);
DSN_DEFINE_bool(pegasus.server,
rocksdb_write_global_seqno,
false,
"If write_global_seqno is true, rocksdb will modify "
"'rocksdb.external_sst_file.global_seqno' of ssttable file during ingest process. "
"If false, it will not be modified.");

rocksdb_wrapper::rocksdb_wrapper(pegasus_server_impl *server)
: replica_base(server),
Expand Down Expand Up @@ -212,6 +218,7 @@ int rocksdb_wrapper::ingest_files(int64_t decree,
rocksdb::IngestExternalFileOptions ifo;
ifo.move_files = true;
ifo.ingest_behind = ingest_behind;
ifo.write_global_seqno = FLAGS_rocksdb_write_global_seqno;
rocksdb::Status s = _db->IngestExternalFile(sst_file_list, ifo);
if (dsn_unlikely(!s.ok())) {
LOG_ERROR_ROCKSDB("IngestExternalFile",
Expand Down