!1350 修复修改最大可用模式most_available_sync未能稳定生效的缺陷

Merge pull request !1350 from chenxiaobin/mvs_reload
This commit is contained in:
opengauss-bot 2022-02-23 11:28:41 +00:00 committed by Gitee
commit da986e78d1
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 11 additions and 3 deletions

View File

@ -387,7 +387,6 @@ void CheckpointerMain(void)
u_sess->attr.attr_storage.CheckPointTimeout = ENABLE_INCRE_CKPT
? u_sess->attr.attr_storage.incrCheckPointTimeout
: u_sess->attr.attr_storage.fullCheckPointTimeout;
most_available_sync = (volatile bool) u_sess->attr.attr_storage.guc_most_available_sync;
/*
* Checkpointer is the last process to shut down, so we ask it to
@ -715,7 +714,6 @@ void CheckpointWriteDelay(int flags, double progress)
if (t_thrd.checkpoint_cxt.got_SIGHUP) {
t_thrd.checkpoint_cxt.got_SIGHUP = false;
ProcessConfigFile(PGC_SIGHUP);
most_available_sync = (volatile bool)u_sess->attr.attr_storage.guc_most_available_sync;
/* update shmem copies of config variables */
UpdateSharedMemoryConfig();
}

View File

@ -82,6 +82,7 @@
#include "replication/datasender.h"
#include "replication/walsender.h"
#include "replication/slot.h"
#include "replication/syncrep.h"
#include "rewrite/rewriteHandler.h"
#include "storage/buf/bufmgr.h"
#include "storage/ipc.h"
@ -6940,6 +6941,8 @@ void reload_configfile(void)
}
u_sess->sig_cxt.got_SIGHUP = false;
ProcessConfigFile(PGC_SIGHUP);
most_available_sync = (volatile bool) u_sess->attr.attr_storage.guc_most_available_sync;
SyncRepUpdateSyncStandbysDefined();
if (currentOwner == NULL) {
ResourceOwnerRelease(t_thrd.utils_cxt.CurrentResourceOwner, RESOURCE_RELEASE_BEFORE_LOCKS, true, true);
ResourceOwnerRelease(t_thrd.utils_cxt.CurrentResourceOwner, RESOURCE_RELEASE_LOCKS, true, true);

View File

@ -40,6 +40,7 @@
#include "utils/memutils.h"
#include "utils/ps_status.h"
#include "utils/guc.h"
#include "replication/syncrep.h"
#define SCHEDULER_TIME_UNIT 1000000 //us
#define ENLARGE_THREAD_TIME 5
@ -63,6 +64,9 @@ static void reloadConfigFileIfNecessary()
if (t_thrd.threadpool_cxt.scheduler->m_getSIGHUP) {
t_thrd.threadpool_cxt.scheduler->m_getSIGHUP = false;
ProcessConfigFile(PGC_SIGHUP);
/* Update most_available_sync if it's modified dynamically. */
most_available_sync = (volatile bool) u_sess->attr.attr_storage.guc_most_available_sync;
SyncRepUpdateSyncStandbysDefined();
}
}

View File

@ -313,8 +313,11 @@ void SyncRepWaitForLSN(XLogRecPtr XactCommitLSN, bool enableHandleCancel)
}
/*
* If we modify the syncmode dynamically, we'll stop wait
* If we modify the syncmode dynamically, we'll stop wait.
* Reload config file here to update most_available_sync if it's modified
* dynamically.
*/
reload_configfile();
if ((t_thrd.walsender_cxt.WalSndCtl->sync_master_standalone && !IS_SHARED_STORAGE_MODE &&
!DelayIntoMostAvaSync(false)) ||
u_sess->attr.attr_storage.guc_synchronous_commit <= SYNCHRONOUS_COMMIT_LOCAL_FLUSH) {