toast及索引类型与主表自适应匹配
This commit is contained in:
@ -482,6 +482,7 @@ static UndoRecordState LoadUndoRecord(UndoRecord *urec, TransactionId *lastXid)
|
||||
}
|
||||
|
||||
int saveInterruptHoldoffCount = t_thrd.int_cxt.InterruptHoldoffCount;
|
||||
uint32 saveCritSectionCount = t_thrd.int_cxt.CritSectionCount;
|
||||
MemoryContext currentContext = CurrentMemoryContext;
|
||||
PG_TRY();
|
||||
{
|
||||
@ -495,6 +496,7 @@ static UndoRecordState LoadUndoRecord(UndoRecord *urec, TransactionId *lastXid)
|
||||
PG_CATCH();
|
||||
{
|
||||
MemoryContext oldContext = MemoryContextSwitchTo(currentContext);
|
||||
t_thrd.int_cxt.CritSectionCount = saveCritSectionCount;
|
||||
state = undo::CheckUndoRecordValid(urec->Urp(), true, lastXid);
|
||||
if (state == UNDO_RECORD_DISCARD || state == UNDO_RECORD_FORCE_DISCARD) {
|
||||
t_thrd.undo_cxt.fetchRecord = false;
|
||||
|
@ -390,6 +390,7 @@ static bool LoadUndoRecordRange(UndoRecord *urec, Buffer *buffer)
|
||||
return false;
|
||||
}
|
||||
int saveInterruptHoldoffCount = t_thrd.int_cxt.InterruptHoldoffCount;
|
||||
uint32 saveCritSectionCount = t_thrd.int_cxt.CritSectionCount;
|
||||
MemoryContext currentContext = CurrentMemoryContext;
|
||||
PG_TRY();
|
||||
{
|
||||
@ -403,6 +404,7 @@ static bool LoadUndoRecordRange(UndoRecord *urec, Buffer *buffer)
|
||||
PG_CATCH();
|
||||
{
|
||||
MemoryContext oldContext = MemoryContextSwitchTo(currentContext);
|
||||
t_thrd.int_cxt.CritSectionCount = saveCritSectionCount;
|
||||
if (BufferIsValid(urec->Buff())) {
|
||||
if (urec->Buff() == *buffer) {
|
||||
*buffer = InvalidBuffer;
|
||||
|
@ -90,6 +90,7 @@ void UndoSpace::ExtendUndoLog(int zid, UndoLogOffset offset, uint32 dbId)
|
||||
uint64 undoSize = (g_instance.undo_cxt.undoTotalSize + g_instance.undo_cxt.undoMetaSize) * BLCKSZ /
|
||||
(1024 * 1024);
|
||||
uint64 limitSize = u_sess->attr.attr_storage.undo_space_limit_size * BLCKSZ / (1024 * 1024);
|
||||
smgrclose(reln);
|
||||
ereport(ERROR, (errmodule(MOD_UNDO), errmsg(UNDOFORMAT(
|
||||
"undo space size %luM > limit size %luM. Please increase the undo_space_limit_size."),
|
||||
undoSize, limitSize)));
|
||||
@ -100,7 +101,8 @@ void UndoSpace::ExtendUndoLog(int zid, UndoLogOffset offset, uint32 dbId)
|
||||
pg_atomic_fetch_add_u32(&g_instance.undo_cxt.undoTotalSize, segBlocks);
|
||||
tail += segSize;
|
||||
}
|
||||
|
||||
|
||||
smgrclose(reln);
|
||||
ereport(DEBUG1, (errmodule(MOD_UNDO), errmsg(UNDOFORMAT(
|
||||
"entxend undo log, total blocks=%u, zid=%d, dbid=%u, head=%lu."),
|
||||
g_instance.undo_cxt.undoTotalSize, zid, dbId, offset)));
|
||||
@ -211,7 +213,7 @@ void UndoSpace::CreateNonExistsUndoFile(int zid, uint32 dbId)
|
||||
*/
|
||||
void UndoSpace::CheckPointUndoSpace(int fd, UndoSpaceType type)
|
||||
{
|
||||
Assert(fd > 0);
|
||||
Assert(fd >= 0);
|
||||
bool retry = false;
|
||||
bool needFlushMetaPage = false;
|
||||
uint32 ret = 0;
|
||||
@ -359,7 +361,7 @@ void UndoSpace::CheckPointUndoSpace(int fd, UndoSpaceType type)
|
||||
|
||||
void UndoSpace::RecoveryUndoSpace(int fd, UndoSpaceType type)
|
||||
{
|
||||
Assert(fd > 0);
|
||||
Assert(fd >= 0);
|
||||
int rc = 0;
|
||||
uint32 zoneId = 0;
|
||||
uint32 spaceMetaSize = 0;
|
||||
|
@ -459,7 +459,7 @@ static void GetMetaFromUzone(UndoZone *uzone, UndoZoneMetaInfo *uspMetaPointer)
|
||||
*/
|
||||
void UndoZone::CheckPointUndoZone(int fd)
|
||||
{
|
||||
Assert(fd > 0);
|
||||
Assert(fd >= 0);
|
||||
bool retry = false;
|
||||
bool needFlushMetaPage = false;
|
||||
int rc = 0;
|
||||
@ -669,7 +669,7 @@ void InitUndoSpace(UndoZone *uzone, UndoSpaceType type)
|
||||
|
||||
void UndoZone::RecoveryUndoZone(int fd)
|
||||
{
|
||||
Assert(fd > 0);
|
||||
Assert(fd >= 0);
|
||||
int rc = 0;
|
||||
uint32 zoneId = 0;
|
||||
uint32 zoneMetaSize = 0;
|
||||
|
Reference in New Issue
Block a user