-
Notifications
You must be signed in to change notification settings - Fork 138
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
Fix[mqbblp::RemoteQueue]: 0 deduplication timeout causes expired PUTs #494
Fix[mqbblp::RemoteQueue]: 0 deduplication timeout causes expired PUTs #494
Conversation
… REPLICA Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
2d2c902
to
37d1450
Compare
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.
looks good, minor comments
@@ -483,6 +483,19 @@ RemoteQueue::RemoteQueue(QueueState* state, | |||
os << '@' << d_state_p->uri().asString(); | |||
d_state_p->setDescription(os.str()); | |||
|
|||
if (deduplicationTimeMs <= 0) { | |||
d_pendingPutsTimeoutNs = 5 * |
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.
let's have a k_
constant instead of 5
Or, the default dedup timeout
<< "non-positive timeout from config [" | ||
<< deduplicationTimeMs << " ms], use a default PUT " | ||
<< "deduplication timeout for scheduler instead [" | ||
<< bmqu::PrintUtil::prettyTimeInterval( |
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.
let's print the minutes, easier to read?
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.
Pretty time interval prints 5.00 m
, you want to print the full 5 minutes
instead, right?
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.
If this is 5.00 m
, then it is ok. Just did not want long string of zeroes
Signed-off-by: Evgeny Malygin <emalygin@bloomberg.net>
@dorjesinpo I moved 5 to unit's constants. Also, changed the log line so it mentions |
deduplicationTimeMs
parameter serves at least 2 roles:With the second point, we got a bug. When we provide 0 timeout, we schedule PUT expiration almost immediately on REPLICA/PROXY, causing some of the PUTs to expire before reaching PRIMARY.
This PR handles 0 (and just for safety negative values, if someone wants to pass -1) for
deduplicationTimeMs
, and now we assume that "zero deduplication timeout means we don't want to expire messages for as long as we can". We use a default 5 minute timer in this case.The sample WARN log from PROXY:
31OCT2024_17:33:11.257 (140251446843136) WARN mqbblp_remotequeue.cpp:488 Remote queue [@bmq://bmq.capmon.priority.sc/dummy]: cannot schedule PUT expiration timer with a non-positive timeout from config [0 ms], use a default PUT expiration timeout for scheduler instead [5.00 m]