peterxcli commented on PR #8260:
URL: https://github.com/apache/ozone/pull/8260#issuecomment-2796706771

   > Moreover, rocksDB already takes care of executing compaction when writes 
are less: 
https://github.com/facebook/rocksdb/wiki/Manual-Compaction?utm_source=chatgpt.com#:~:text=CompactRangeOptions%3A%3Aallow_write_stall
   > 
   > > CompactRangeOptions::allow_write_stall When set to true, it will execute 
immediately even if doing so would cause the DB to enter write stall mode. 
Otherwise, it'll sleep until load is low enough. Default value is false
   
   @Tejaskriya It seems if `allow_write_stall` set to false, it can only aware 
the rocksDB internal statue(eg. memtable flush)
   ref: 
[DBImpl::WaitUntilFlushWouldNotStallWrites](https://github.com/facebook/rocksdb/blob/56359da69132d769e97f0a7cc89681d3500e166d/db/db_impl/db_impl_compaction_flush.cc#L2632-L2707)
   
   
   >  as we are using BackgroundService, there is no pre-existing way to 
directly add a throttle on cpu usage. We can sleep + resume the thread, but 
afaik, compaction will be holding a lock, so I am not sure if this could cause 
issues, could you share your insights on this?
   
   You can refer to 
[TiKV:compact.rs](https://github.com/tikv/tikv/blob/master/components/raftstore/src/store/worker/compact.rs#L30-L52).
 
   I also asked grok to extract the `periodic compactFull` logic from that 
file, you can also take a look.
   https://grok.com/share/bGVnYWN5_f5a59ddd-7d08-4313-a87c-1875e6a9e9e6
   


-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


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

Reply via email to