This is an automated email from the ASF dual-hosted git repository.

wangdan pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-pegasus.git


The following commit(s) were added to refs/heads/master by this push:
     new 99456f491 fix(rocksdb): turn off write_global_seqno by default (#1563)
99456f491 is described below

commit 99456f49150614ae44c6111735c32c841934cadf
Author: Pengfan Lu <[email protected]>
AuthorDate: Tue Jul 11 14:35:31 2023 +0800

    fix(rocksdb): turn off write_global_seqno by default (#1563)
    
    https://github.com/apache/incubator-pegasus/issues/1562
    
    Add this option to turn off rocksdb modifying 
`rocksdb.external_sst_file.global_seqno`
    field of external sst file during ingest process. This is used to address a 
coredump
    caused by incorrect field value in RocksDB. This pull request fixs the bug 
above.
    Rocksdb 6.6.4 no longer recommends using this field.
    
    ```diff
    [pegasus.server]
    + rocksdb_write_global_seqno = false
    ```
---
 src/server/config.ini          | 1 +
 src/server/rocksdb_wrapper.cpp | 7 +++++++
 2 files changed, 8 insertions(+)

diff --git a/src/server/config.ini b/src/server/config.ini
index 18c776e23..2d2b7d19d 100644
--- a/src/server/config.ini
+++ b/src/server/config.ini
@@ -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
diff --git a/src/server/rocksdb_wrapper.cpp b/src/server/rocksdb_wrapper.cpp
index 64d37d9be..59cd199d2 100644
--- a/src/server/rocksdb_wrapper.cpp
+++ b/src/server/rocksdb_wrapper.cpp
@@ -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),
@@ -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",


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to