You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2021/09/29 01:53:26 UTC

[GitHub] [incubator-pegasus] ZhongChaoqiang commented on a change in pull request #817: feat: add a config of periodic_compaction_seconds in rocksdb

ZhongChaoqiang commented on a change in pull request #817:
URL: https://github.com/apache/incubator-pegasus/pull/817#discussion_r718088879



##########
File path: src/server/pegasus_server_impl_init.cpp
##########
@@ -527,6 +527,12 @@ pegasus_server_impl::pegasus_server_impl(dsn::replication::replica *r)
     _key_ttl_compaction_filter_factory = std::make_shared<KeyWithTTLCompactionFilterFactory>();
     _data_cf_opts.compaction_filter_factory = _key_ttl_compaction_filter_factory;
 
+    _data_cf_opts.periodic_compaction_seconds =
+        dsn_config_get_value_uint64("pegasus.server",
+                                    "rocksdb_periodic_compaction_seconds",
+                                    30 * 24 * 60 * 60,

Review comment:
       The default value of periodic_compaction_seconds is 30 days.It is turned on in column_family.
   Below is code of rocksdb.
   ```
     const uint64_t kAdjustedPeriodicCompSecs = 30 * 24 * 60 * 60;
   
     // Turn on periodic compactions and set them to occur once every 30 days if
     // compaction filters are used and periodic_compaction_seconds is set to the
     // default value.
     if (result.compaction_style != kCompactionStyleFIFO) {
       if ((result.compaction_filter != nullptr ||
            result.compaction_filter_factory != nullptr) &&
           result.periodic_compaction_seconds == kDefaultPeriodicCompSecs &&
           is_block_based_table) {
         result.periodic_compaction_seconds = kAdjustedPeriodicCompSecs;
       }
     }
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org