diff --git a/src/gausskernel/storage/access/ustore/knl_pruneuheap.cpp b/src/gausskernel/storage/access/ustore/knl_pruneuheap.cpp index f0008ed4c..801ff6cd3 100644 --- a/src/gausskernel/storage/access/ustore/knl_pruneuheap.cpp +++ b/src/gausskernel/storage/access/ustore/knl_pruneuheap.cpp @@ -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); } diff --git a/src/gausskernel/storage/access/ustore/knl_uheap.cpp b/src/gausskernel/storage/access/ustore/knl_uheap.cpp index 553a2d041..0179f98c5 100644 --- a/src/gausskernel/storage/access/ustore/knl_uheap.cpp +++ b/src/gausskernel/storage/access/ustore/knl_uheap.cpp @@ -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; } diff --git a/src/include/access/ustore/knl_upage.h b/src/include/access/ustore/knl_upage.h index dbae60e16..a8e8f79ff 100644 --- a/src/include/access/ustore/knl_upage.h +++ b/src/include/access/ustore/knl_upage.h @@ -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