mirror of https://github.com/citusdata/citus.git
Limit number of stats collection retries to once a day.
parent
78a2cd9052
commit
747e439601
|
@ -214,7 +214,9 @@ CitusMaintenanceDaemonMain(Datum main_arg)
|
||||||
{
|
{
|
||||||
Oid databaseOid = DatumGetObjectId(main_arg);
|
Oid databaseOid = DatumGetObjectId(main_arg);
|
||||||
MaintenanceDaemonDBData *myDbData = NULL;
|
MaintenanceDaemonDBData *myDbData = NULL;
|
||||||
TimestampTz nextStatsCollectionTime USED_WITH_LIBCURL_ONLY = GetCurrentTimestamp();
|
TimestampTz nextStatsCollectionTime USED_WITH_LIBCURL_ONLY =
|
||||||
|
TimestampTzPlusMilliseconds(GetCurrentTimestamp(), 60 * 1000);
|
||||||
|
bool retryStatsCollection USED_WITH_LIBCURL_ONLY = false;
|
||||||
ErrorContextCallback errorCallback;
|
ErrorContextCallback errorCallback;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -321,8 +323,6 @@ CitusMaintenanceDaemonMain(Datum main_arg)
|
||||||
FlushDistTableCache();
|
FlushDistTableCache();
|
||||||
WarnIfSyncDNS();
|
WarnIfSyncDNS();
|
||||||
statsCollectionSuccess = CollectBasicUsageStatistics();
|
statsCollectionSuccess = CollectBasicUsageStatistics();
|
||||||
}
|
|
||||||
|
|
||||||
if (statsCollectionSuccess)
|
if (statsCollectionSuccess)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
|
@ -331,16 +331,28 @@ CitusMaintenanceDaemonMain(Datum main_arg)
|
||||||
* collection in a minute.
|
* collection in a minute.
|
||||||
*/
|
*/
|
||||||
CheckForUpdates();
|
CheckForUpdates();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If statistics collection was successful the next collection is
|
||||||
|
* 24-hours later. Also, if this was a retry attempt we don't do
|
||||||
|
* any more retries until 24-hours later, so we limit number of
|
||||||
|
* retries to one.
|
||||||
|
*/
|
||||||
|
if (statsCollectionSuccess || retryStatsCollection)
|
||||||
|
{
|
||||||
nextStatsCollectionTime =
|
nextStatsCollectionTime =
|
||||||
TimestampTzPlusMilliseconds(GetCurrentTimestamp(),
|
TimestampTzPlusMilliseconds(GetCurrentTimestamp(),
|
||||||
STATS_COLLECTION_TIMEOUT_MILLIS);
|
STATS_COLLECTION_TIMEOUT_MILLIS);
|
||||||
|
retryStatsCollection = false;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
nextStatsCollectionTime =
|
nextStatsCollectionTime =
|
||||||
TimestampTzPlusMilliseconds(GetCurrentTimestamp(),
|
TimestampTzPlusMilliseconds(GetCurrentTimestamp(),
|
||||||
STATS_COLLECTION_RETRY_TIMEOUT_MILLIS);
|
STATS_COLLECTION_RETRY_TIMEOUT_MILLIS);
|
||||||
|
retryStatsCollection = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
CommitTransactionCommand();
|
CommitTransactionCommand();
|
||||||
|
|
Loading…
Reference in New Issue