提交 e24ddd70 编写于 作者: D David Kimura 提交者: Ashwin Agrawal

Update GDD to not assign global transaction ids

Currently GDD sets DistributedTransactionContext to
DTX_CONTEXT_QD_DISTRIBUTED_CAPABLE and as a result allocates distributed
transaction id. It creates entry in ProcGlobal->allTmGxact with state
DTX_STATE_ACTIVE_NOT_DISTRIBUTED. The effect of this is that any query
taking a snapshot will see this transaction as in progress. Since GDD
transaction is short lived it is not an issue in general, but in CI it
causes flaky behavior for some of the vacuum tests. The flaky behavior
shows up as unvacuumed tables where the vacuum snapshot was taken while
GDD transaction was running thereby forcing vacuum to lower its oldest
XMIN. Current behavior of GDD consuming a distributed transaction id
(every 2 minutes by default) is also wasteful behavior.

Currently GDD also sends a snapshot to QE, but this isn't required and
is wasteful as well.

In this change for GDD we keep DistributedTransactionContext as
DTX_CONTEXT_LOCAL_ONLY and avoid dispatching snapshots to QEs.
Co-authored-by: NAshwin Agrawal <aagrawal@pivotal.io>
上级 e2c699c8
......@@ -222,13 +222,6 @@ GlobalDeadLockDetectorMain(int argc, char *argv[])
InitBufferPoolBackend();
InitXLOGAccess();
/*
* This is tricky, adding SharedLocalSnapshotSlot to make GDD to be a dispatcher,
* see isDtxQueryDispatcher(), so GDD can get newest segment configuration.
* see setCurrentGxact()
*/
addSharedSnapshot("GDD Dispatcher", gp_session_id);
SetProcessingMode(NormalProcessing);
/* Allocate MemoryContext */
......
......@@ -132,7 +132,7 @@ pg_dist_wait_status(PG_FUNCTION_ARGS)
int i;
CdbDispatchCommand("SELECT * FROM pg_catalog.pg_dist_wait_status()",
DF_WITH_SNAPSHOT, &ctx->cdb_pgresults);
DF_NONE, &ctx->cdb_pgresults);
if (ctx->cdb_pgresults.numResults == 0)
elog(ERROR, "pg_dist_wait_status() didn't get back any data from the segDBs");
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册