mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 08:40:50 +00:00
Merge pull request #56609 from jsc0218/LessAggressiveRescheduleWithUnsuccessfulConn
Less aggressive reschedule with unavailable conn of PG
This commit is contained in:
commit
d3b6310fe1
@ -36,6 +36,7 @@ namespace ErrorCodes
|
||||
|
||||
static const auto suffix = ".removed";
|
||||
static const auto cleaner_reschedule_ms = 60000;
|
||||
static const auto reschedule_error_multiplier = 10;
|
||||
|
||||
DatabasePostgreSQL::DatabasePostgreSQL(
|
||||
ContextPtr context_,
|
||||
@ -332,7 +333,14 @@ void DatabasePostgreSQL::removeOutdatedTables()
|
||||
catch (...)
|
||||
{
|
||||
tryLogCurrentException(__PRETTY_FUNCTION__);
|
||||
cleaner_task->scheduleAfter(cleaner_reschedule_ms);
|
||||
|
||||
/** Avoid repeated interrupting other normal routines (they acquire locks!)
|
||||
* for the case of unavailable connection, since it is possible to be
|
||||
* unsuccessful again, and the unsuccessful conn is very time-consuming:
|
||||
* connection period is exclusive and timeout is at least 2 seconds for
|
||||
* PostgreSQL.
|
||||
*/
|
||||
cleaner_task->scheduleAfter(reschedule_error_multiplier * cleaner_reschedule_ms);
|
||||
return;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user