!6331 strip useless code

Merge pull request !6331 from lyannaa/master914
This commit is contained in:
opengauss_bot
2024-09-18 01:06:54 +00:00
committed by Gitee
3 changed files with 3 additions and 26 deletions

View File

@ -895,11 +895,6 @@ static int UHeapPruneItem(const RelationBuffer *relbuf, OffsetNumber offnum, Tra
* that can be freed.
*/
Assert(!TransactionIdIsValid(xid) || !TransactionIdIsInProgress(xid));
if (TransactionIdIsValid(xid) && TransactionIdIsInProgress(xid)) {
ereport(PANIC, (errcode(ERRCODE_DATA_CORRUPTED),
errmsg("Tuple will be pruned but xid is inprogress, xid=%lu, oldestxmin=%lu, globalRecycleXid=%lu.",
xid, oldestXmin, pg_atomic_read_u64(&g_instance.undo_cxt.globalRecycleXid))));
}
/* short aligned */
*spaceFreed += SHORTALIGN(tup.disk_tuple_size);
}

View File

@ -565,10 +565,6 @@ Oid UHeapInsert(RelationData *rel, UHeapTupleData *utuple, CommandId cid, BulkIn
ereport(ERROR, (errcode(ERRCODE_INVALID_PARAMETER_VALUE), errmsg("The insert tuple is NULL")));
}
Assert(utuple->tupTableType == UHEAP_TUPLE);
if (t_thrd.ustore_cxt.urecvec) {
t_thrd.ustore_cxt.urecvec->Reset(false);
}
TransactionId fxid = GetTopTransactionId();
@ -2024,10 +2020,6 @@ TM_Result UHeapDelete(Relation relation, ItemPointer tid, CommandId cid, Snapsho
int retryTimes = 0;
Assert(ItemPointerIsValid(tid));
if (t_thrd.ustore_cxt.urecvec) {
t_thrd.ustore_cxt.urecvec->Reset(false);
}
BlockNumber blkno = ItemPointerGetBlockNumber(tid);
Page page = GetPageBuffer(relation, blkno, buffer);
@ -2464,10 +2456,6 @@ TM_Result UHeapUpdate(Relation relation, Relation parentRelation, ItemPointer ot
Assert(newtup->tupTableType == UHEAP_TUPLE);
Assert(ItemPointerIsValid(otid));
if (t_thrd.ustore_cxt.urecvec) {
t_thrd.ustore_cxt.urecvec->Reset(false);
}
/*
* Fetch the list of attributes to be checked for various operations.
*
@ -4396,7 +4384,6 @@ CommandId UHeapTupleGetCid(UHeapTuple utuple, Buffer buffer)
}
Assert(IS_VALID_UNDO_REC_PTR(tdinfo.urec_add));
VerifyMemoryContext();
UndoRecord *urec = New(CurrentMemoryContext)UndoRecord();
urec->Reset(tdinfo.urec_add);
urec->SetMemoryContext(CurrentMemoryContext);
@ -4468,6 +4455,7 @@ void UHeapResetPreparedUndo()
} else {
for (int i = 0; i < t_thrd.ustore_cxt.undo_buffer_idx; i++) {
if (BufferIsValid(t_thrd.ustore_cxt.undo_buffers[i].buf)) {
#ifdef USE_ASSERT_CHECKING
BufferDesc *bufdesc = GetBufferDescriptor(t_thrd.ustore_cxt.undo_buffers[i].buf - 1);
if (LWLockHeldByMeInMode(BufferDescriptorGetContentLock(bufdesc), LW_EXCLUSIVE)) {
LWLock *lock = BufferDescriptorGetContentLock(bufdesc);
@ -4478,6 +4466,7 @@ void UHeapResetPreparedUndo()
BufferGetBlockNumber(t_thrd.ustore_cxt.undo_buffers[i].buf),
t_thrd.ustore_cxt.undo_buffers[i].buf, lock->state)));
}
#endif
t_thrd.ustore_cxt.undo_buffers[i].inUse = false;
t_thrd.ustore_cxt.undo_buffers[i].zero = false;
}

View File

@ -146,14 +146,7 @@
* ItemIdChangeLen
* Change the length of itemid.
*/
#define RowPtrChangeLen(_rowptr, _length) \
do { \
if (RowPtrGetOffset(_rowptr) + _length > BLCKSZ) { \
elog(PANIC, "row pointer error, offset:%u, flags:%u, len:%u", RowPtrGetOffset(_rowptr), (_rowptr)->flags, \
(_length)); \
} \
(_rowptr)->len = (_length); \
} while (0)
#define RowPtrChangeLen(_rowptr, _length) ((_rowptr)->len = (_length))
/*
* RowPtrIsDead