Do not allow concurrent run of sweep instances#8320
Do not allow concurrent run of sweep instances#8320AlexPeshkoff merged 4 commits intoFirebirdSQL:masterfrom
Conversation
|
As far as I can see isc_sweep_concurrent_instance is returned to the client which started sweep. Where is is handled in a case when sweep started automatically? IMO it should be silently ignored. |
|
As I can see, |
|
OK. I reviewed the code once again. Initial problem can be fixed much simpler: diff --git a/src/jrd/tra.cpp b/src/jrd/tra.cpp But suggested patch contains new feature - user is notified what happened, without it sweep silently finishes in a moment. But I do not understand - why no diags in cases of RO database and explicitly set ATT_no_cleanup? If you want to add diags for sweep startup failure all cases should better be taken into an account. |
Yeah, I agree. I will add more error messages. |
How it works for auto-sweep ? |
See |
* Do not allow run concurrent sweep instances * Silently ignore error about concurrent sweep instance when we try to run auto sweep * Add more error messages that describe a reason of failed sweep startup * Pass ISC_STATUS instead of Arg::Gds to function --------- Co-authored-by: Artyom Ivanov <[email protected]>
Old code has a bug where if we already have a sweep instance running, and some one call sweep once more,
allowSweepRun()will return false and we are gonna callclearSweepFlags(), that will reset sweep flags and release a sweep lock. This will open an opportunity to run a second sweep instance for both Super and Classic server.