提交 71afdcd6 编写于 作者: A Ashwin Agrawal 提交者: Xin Zhang

Remove resync eofs sanity checks at end of prepare.

上级 694ce55f
......@@ -3659,100 +3659,6 @@ void PersistentFileSysObj_PreparedEndXactAction(
}
}
/*
* For both COMMIT and ABORT, release our intent to add Append-Only mirror resync EOFs.
*/
if (persistentObjects->typed.appendOnlyMirrorResyncEofsCount > 0 &&
prepareAppendOnlyIntentCount > 0)
{
PersistentEndXactAppendOnlyMirrorResyncEofs *eofsExample;
int oldSystemAppendOnlyCommitWorkCount;
int newSystemAppendOnlyCommitWorkCount;
int resultSystemAppendOnlyCommitWorkCount;
eofsExample = &persistentObjects->typed.appendOnlyMirrorResyncEofs[0];
if (persistentObjects->typed.appendOnlyMirrorResyncEofsCount != prepareAppendOnlyIntentCount)
elog(ERROR,
"Append-Only Mirror Resync EOFs intent count mismatch "
"(shared-memory count %d, xlog count %d). "
"Example relation %u/%u/%u, segment file #%d (persistent serial num " INT64_FORMAT ", TID %s). "
"Distributed transaction id %s (local prepared xid %u)",
prepareAppendOnlyIntentCount,
persistentObjects->typed.appendOnlyMirrorResyncEofsCount,
eofsExample->relFileNode.spcNode,
eofsExample->relFileNode.dbNode,
eofsExample->relFileNode.relNode,
eofsExample->segmentFileNum,
eofsExample->persistentSerialNum,
ItemPointerToString(&eofsExample->persistentTid),
gid,
preparedXid);
LWLockAcquire(FileRepAppendOnlyCommitCountLock , LW_EXCLUSIVE);
oldSystemAppendOnlyCommitWorkCount = FileRepPrimary_GetAppendOnlyCommitWorkCount();
newSystemAppendOnlyCommitWorkCount =
oldSystemAppendOnlyCommitWorkCount -
persistentObjects->typed.appendOnlyMirrorResyncEofsCount;
if (newSystemAppendOnlyCommitWorkCount < 0)
elog(ERROR,
"Append-Only Mirror Resync EOFs intent count would go negative "
"(enter system count %d, subtract count %d). "
"Example relation %u/%u/%u, segment file #%d (persistent serial num " INT64_FORMAT ", TID %s). "
"Distributed transaction id %s (local prepared xid %u)",
oldSystemAppendOnlyCommitWorkCount,
persistentObjects->typed.appendOnlyMirrorResyncEofsCount,
eofsExample->relFileNode.spcNode,
eofsExample->relFileNode.dbNode,
eofsExample->relFileNode.relNode,
eofsExample->segmentFileNum,
eofsExample->persistentSerialNum,
ItemPointerToString(&eofsExample->persistentTid),
gid,
preparedXid);
resultSystemAppendOnlyCommitWorkCount =
FileRepPrimary_FinishedAppendOnlyCommitWork(
persistentObjects->typed.appendOnlyMirrorResyncEofsCount);
// Should match since we are under FileRepAppendOnlyCommitCountLock EXCLUSIVE.
Assert(newSystemAppendOnlyCommitWorkCount == resultSystemAppendOnlyCommitWorkCount);
if (Debug_persistent_print ||
Debug_persistent_appendonly_commit_count_print)
elog(Persistent_DebugPrintLevel(),
"PersistentFileSysObj_PreparedEndXactAction: Append-Only Mirror Resync EOFs finishing commit work "
"(enter system count %d, subtract count %d, result system count %d). "
"Example relation %u/%u/%u, segment file #%d (persistent serial num " INT64_FORMAT ", TID %s) "
"Distributed transaction id %s (local prepared xid %u)",
oldSystemAppendOnlyCommitWorkCount,
persistentObjects->typed.appendOnlyMirrorResyncEofsCount,
resultSystemAppendOnlyCommitWorkCount,
eofsExample->relFileNode.spcNode,
eofsExample->relFileNode.dbNode,
eofsExample->relFileNode.relNode,
eofsExample->segmentFileNum,
eofsExample->persistentSerialNum,
ItemPointerToString(&eofsExample->persistentTid),
gid,
preparedXid);
LWLockRelease(FileRepAppendOnlyCommitCountLock);
}
else if (prepareAppendOnlyIntentCount > 0)
{
elog(ERROR,
"Append-Only Mirror Resync EOFs intent count in shared-memory non-zero (%d) and xlog count is zero. "
"Distributed transaction id %s (local prepared xid %u)",
prepareAppendOnlyIntentCount,
gid,
preparedXid);
}
goto jumpoverinjectfaultexit;
injectfaultexit:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册