提交 90b42662 编写于 作者: A Adam Berlin 提交者: Adam Berlin

Replace problematic modification of global variable with a constant argument.

There was a concern that an exception during GetNonHistoricCatalogSnapshot would be problematic after setting the global variable and not resetting it back to its original value. This patch threads the desired distributed transaction context into GetNonHistoricCatalogSnapshot without modifying global state.
上级 a52e567c
......@@ -295,20 +295,7 @@ GetCatalogSnapshot(Oid relid)
if (HistoricSnapshotActive())
return HistoricSnapshot;
/*
* GPDB_94_MERGE_FIXME: This is typically the way SnapshotNow was.
* I think it makes sense to use a local snapshot for this.. But
* update comments, and verify all the places where this is used.
* Also, do we need a TRY-CATCH block to reset DistributedTransactionContext
* on error?
*/
DtxContext saveDistributedTransactionContext = DistributedTransactionContext;
DistributedTransactionContext = DTX_CONTEXT_LOCAL_ONLY;
Snapshot snapshot = GetNonHistoricCatalogSnapshot(relid, DistributedTransactionContext);
DistributedTransactionContext = saveDistributedTransactionContext;
return snapshot;
return GetNonHistoricCatalogSnapshot(relid, DTX_CONTEXT_LOCAL_ONLY);
}
/*
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册