-
Notifications
You must be signed in to change notification settings - Fork 314
fix: some replicas never start manaul compact after zero o'clock #1556
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
base: master
Are you sure you want to change the base?
Changes from all commits
1043f90
8e296b8
30faae1
455eb05
65f0b6f
b51b700
87093ca
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ | |
|
||
#include <limits.h> | ||
#include <rocksdb/options.h> | ||
#include <chrono> | ||
#include <list> | ||
#include <ostream> | ||
#include <set> | ||
|
@@ -301,6 +302,20 @@ 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); | ||
|
||
_pfc_manual_compact_enqueue_count->increment(); | ||
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(); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to increment before enqueue too? |
||
manual_compact(options); | ||
}, | ||
0, | ||
std::chrono::seconds(60)); | ||
LOG_INFO_PREFIX("retry 60 seconds later,now task enqueue time({})ms", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another question is: when to give up retrying? |
||
_manual_compact_enqueue_time_ms.load()); | ||
return; | ||
} | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The execute time is 60 seconds later, the enqueue time is now, right?