提交 bf945b36 编写于 作者: H Heikki Linnakangas

Introduce a testing GUC, to burn through XIDs more quickly.

This makes it faster to reach XID wraparound. I haven't written any
automated tests for that, but at least this makes manual testing easier.
上级 4e655714
......@@ -186,6 +186,28 @@ GetNewTransactionId(bool isSubXact)
*/
TransactionIdAdvance(ShmemVariableCache->nextXid);
/*
* To aid testing, you can set the debug_burn_xids GUC, to consume XIDs
* faster. If set, we bump the XID counter to the next value divisible by
* 1024, minus one. The idea is to skip over "boring" XID ranges, but
* still step through XID wraparound, CLOG page boundaries etc. one XID
* at a time.
*/
if (Debug_burn_xids)
{
TransactionId xx;
uint32 r;
xx = ShmemVariableCache->nextXid;
r = xx % 1024;
if (r > 1 && r < 1023)
{
xx += 1024 - r - 1;
ShmemVariableCache->nextXid = xx;
}
}
/*
* We must store the new XID into the shared ProcArray before releasing
* XidGenLock. This ensures that every active XID older than
......
......@@ -75,6 +75,8 @@ bool Debug_print_slice_table; /* Shall we log the slice table? */
bool Debug_resource_group; /* Shall we log the resource group? */
bool Debug_burn_xids;
bool gp_external_enable_exec = true; /* allow ext tables with EXECUTE */
int gp_external_max_segs; /* max segdbs per gpfdist/gpfdists URI */
......
......@@ -1130,6 +1130,16 @@ struct config_bool ConfigureNamesBool_gp[] =
false, NULL, NULL
},
{
{"debug_burn_xids", PGC_USERSET, DEVELOPER_OPTIONS,
gettext_noop("Consume a lot of XIDs, for testing purposes."),
NULL,
GUC_NO_SHOW_ALL | GUC_NOT_IN_SAMPLE
},
&Debug_burn_xids,
false, NULL, NULL
},
{
{"gp_cost_hashjoin_chainwalk", PGC_USERSET, QUERY_TUNING_COST,
gettext_noop("Enable the cost for walking the chain in the hash join"),
......
......@@ -239,6 +239,8 @@ extern bool Debug_print_slice_table;
extern bool Debug_resource_group;
extern bool Debug_burn_xids;
/*
* gp_external_enable_exec
*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册