Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions src/backend/tcop/postgres.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
#include "utils/lsyscache.h"
#include "utils/memutils.h"
#include "utils/ps_status.h"
#include "utils/resgroup.h"
#include "utils/snapmgr.h"
#include "utils/timeout.h"
#include "utils/timestamp.h"
Expand Down Expand Up @@ -1569,10 +1570,29 @@ CheckDebugDtmActionSqlCommandTag(const char *sqlCommandTag)
static void
restore_guc_to_QE(void )
{
ListCell *lc;
bool saved_resgroup_bypass = gp_resource_group_bypass;

Assert(Gp_role == GP_ROLE_DISPATCH && gp_guc_restore_list);
ListCell *lc;

start_xact_command();
/* debug_query_string (which is used to make a bypass decision) is
* unavailable in this context meaning that we won't bypass resource
* group here.
* To forse the bypass we temporarily set gp_resource_group_bypass manually.
*
*/
PG_TRY();
{
gp_resource_group_bypass = true;
start_xact_command();
}
PG_CATCH();
{
gp_resource_group_bypass = saved_resgroup_bypass;
PG_RE_THROW();
}
PG_END_TRY();
gp_resource_group_bypass = saved_resgroup_bypass;

foreach(lc, gp_guc_restore_list)
{
Expand Down
5 changes: 5 additions & 0 deletions src/test/isolation2/input/resgroup/resgroup_bypass.source
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ ALTER RESOURCE GROUP rg_bypass_test set concurrency 1;
ALTER RESOURCE GROUP rg_bypass_test set concurrency 0;
61: SET enable_hashagg to on;
61: SHOW enable_hashagg;
-- Roll back a GUC change in one query message; restoration must not wait
-- for a resource-group slot (concurrency is still zero).
61: SET DateStyle = 'ISO, MDY';
61: SET DateStyle = 'SQL, DMY'; SET work_mem = 'invalid';
61: SHOW DateStyle;
61: invalid_syntax;
61q:

Expand Down
11 changes: 11 additions & 0 deletions src/test/isolation2/output/resgroup/resgroup_bypass.source
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,17 @@ SET
----------------
on
(1 row)
-- Roll back a GUC change in one query message; restoration must not wait
-- for a resource-group slot (concurrency is still zero).
61: SET DateStyle = 'ISO, MDY';
SET
61: SET DateStyle = 'SQL, DMY'; SET work_mem = 'invalid';
ERROR: invalid value for parameter "work_mem": "invalid"
61: SHOW DateStyle;
DateStyle
-----------
ISO, MDY
(1 row)
61: invalid_syntax;
ERROR: syntax error at or near "invalid_syntax"
LINE 1: invalid_syntax;
Expand Down
Loading