automate create restory sync point

pull/7723/head
Alexandre Kalendarev 2024-11-05 16:33:12 +03:00
parent f6959715dc
commit 81448abd3e
2 changed files with 27 additions and 0 deletions

View File

@ -112,6 +112,7 @@
#include "distributed/transaction_recovery.h"
#include "distributed/utils/citus_stat_tenants.h"
#include "distributed/utils/directory.h"
#include "distributed/utils/restore_interval.h"
#include "distributed/worker_log_messages.h"
#include "distributed/worker_manager.h"
#include "distributed/worker_protocol.h"
@ -2678,6 +2679,26 @@ RegisterCitusConfigVariables(void)
GUC_STANDARD,
NULL, NULL, NULL);
DefineCustomStringVariable(
"citus.restore_point_interval",
gettext_noop("Sets the timeout for periodic recovery cluster point"),
NULL,
&RestorePointInterval,
"never",
PGC_SIGHUP,
GUC_STANDARD,
GucCheckInterval, NULL, NULL);
DefineCustomStringVariable(
"citus.restore_point_interval_name",
gettext_noop("Sets the prefix of pointname for the periodic recovery cluster point"),
NULL,
&RestorePointIntervalName,
NULL,
PGC_SIGHUP,
GUC_STANDARD,
NULL, NULL, NULL);
/* warn about config items in the citus namespace that are not registered above */
EmitWarningsOnPlaceholders("citus");

View File

@ -59,6 +59,7 @@
#include "distributed/shard_cleaner.h"
#include "distributed/statistics_collection.h"
#include "distributed/transaction_recovery.h"
#include "distributed/utils/restore_interval.h"
#include "distributed/version_compat.h"
/*
@ -955,6 +956,11 @@ CitusMaintenanceDaemonMain(Datum main_arg)
*/
}
if ( restorePointIntervalMode && IsCoordinator() && !RecoveryInProgress())
{
CheckRestoreInterval(MyDatabaseId, myDbData->userOid);
}
if (got_SIGHUP)
{
got_SIGHUP = false;