acelyc111 commented on code in PR #1556:
URL:
https://github.com/apache/incubator-pegasus/pull/1556#discussion_r1253832620
##########
src/server/pegasus_manual_compact_service.cpp:
##########
@@ -301,6 +301,22 @@ void pegasus_manual_compact_service::manual_compact(const
rocksdb::CompactRangeO
LOG_INFO_PREFIX("ignored compact because exceed
max_concurrent_running_count({})",
_max_concurrent_running_count.load());
_manual_compact_enqueue_time_ms.store(0);
+
+ // bug fix : https://github.com/apache/incubator-pegasus/issues/1479
+ // now_timestamp return dsn_now_ms()
Review Comment:
I don't think it's necessary, remove this line.
##########
src/server/pegasus_manual_compact_service.cpp:
##########
@@ -301,6 +301,22 @@ void pegasus_manual_compact_service::manual_compact(const
rocksdb::CompactRangeO
LOG_INFO_PREFIX("ignored compact because exceed
max_concurrent_running_count({})",
_max_concurrent_running_count.load());
_manual_compact_enqueue_time_ms.store(0);
+
+ // bug fix : https://github.com/apache/incubator-pegasus/issues/1479
+ // now_timestamp return dsn_now_ms()
+ int loop_enqueue_time = now_timestamp() + 60 * 1000;
+ _manual_compact_enqueue_time_ms.store(loop_enqueue_time);
+ dsn::tasking::enqueue(LPC_MANUAL_COMPACT,
+ &_app->_tracker,
+ [this, options]() {
+
_pfc_manual_compact_enqueue_count->decrement();
Review Comment:
Need to increment before enqueue too?
##########
src/server/pegasus_manual_compact_service.cpp:
##########
@@ -301,6 +301,22 @@ void pegasus_manual_compact_service::manual_compact(const
rocksdb::CompactRangeO
LOG_INFO_PREFIX("ignored compact because exceed
max_concurrent_running_count({})",
_max_concurrent_running_count.load());
_manual_compact_enqueue_time_ms.store(0);
+
+ // bug fix : https://github.com/apache/incubator-pegasus/issues/1479
+ // now_timestamp return dsn_now_ms()
+ int loop_enqueue_time = now_timestamp() + 60 * 1000;
Review Comment:
The execute time is 60 seconds later, the enqueue time is now, right?
##########
src/server/pegasus_manual_compact_service.cpp:
##########
@@ -301,6 +301,22 @@ void pegasus_manual_compact_service::manual_compact(const
rocksdb::CompactRangeO
LOG_INFO_PREFIX("ignored compact because exceed
max_concurrent_running_count({})",
_max_concurrent_running_count.load());
_manual_compact_enqueue_time_ms.store(0);
+
+ // bug fix : https://github.com/apache/incubator-pegasus/issues/1479
+ // now_timestamp return dsn_now_ms()
+ int loop_enqueue_time = now_timestamp() + 60 * 1000;
+ _manual_compact_enqueue_time_ms.store(loop_enqueue_time);
+ dsn::tasking::enqueue(LPC_MANUAL_COMPACT,
+ &_app->_tracker,
+ [this, options]() {
+
_pfc_manual_compact_enqueue_count->decrement();
+ manual_compact(options);
+ },
+ 0,
+ std::chrono::seconds(60));
+ LOG_INFO_PREFIX(
+ "ignored compact task re enqueue to wait for next execute,now task
enqueue time({})ms",
Review Comment:
Just say retry 60 seconds later?
--
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]