Ensure that "pause replay of wal"/"resume replay of wal" are enabled/disabled appropriately. #6026

This commit is contained in:
Yogesh Mahajan 2023-05-16 11:28:48 +05:30 committed by GitHub
parent 8ea3346a9d
commit 30107e38f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -1793,7 +1793,7 @@ class ServerNode(PGChildNodeView):
try:
manager = get_driver(PG_DEFAULT_DRIVER).connection_manager(sid)
conn = manager.connection()
msg = None
# Execute SQL to pause or resume WAL replay
if conn.connected():
if pause:
@ -1806,6 +1806,7 @@ class ServerNode(PGChildNodeView):
return internal_server_error(
errormsg=str(res)
)
msg = gettext('WAL replay paused')
else:
sql = "SELECT pg_xlog_replay_resume();"
if manager.version >= 100000:
@ -1816,9 +1817,10 @@ class ServerNode(PGChildNodeView):
return internal_server_error(
errormsg=str(res)
)
msg = gettext('WAL replay resumed')
return make_json_response(
success=1,
info=gettext('WAL replay paused'),
info=msg,
data={'in_recovery': True, 'wal_pause': pause}
)
return gone(errormsg=gettext('Please connect the server.'))

View File

@ -380,7 +380,7 @@ define('pgadmin.node.server', [
getApiInstance().delete(
obj.generate_url(i, 'wal_replay' , d, true)
).then(({data: res})=> {
obj.on_done(res, t, i);
obj.callbacks.on_done(res, t, i);
}).catch(function(error) {
Notify.pgRespErrorNotify(error);
t.unload(i);
@ -401,7 +401,7 @@ define('pgadmin.node.server', [
getApiInstance().put(
obj.generate_url(i, 'wal_replay' , d, true)
).then(({data: res})=> {
obj.on_done(res, t, i);
obj.callbacks.on_done(res, t, i);
}).catch(function(error) {
Notify.pgRespErrorNotify(error);
t.unload(i);