Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
reshke committed Dec 18, 2024
1 parent 6f6c273 commit 4e3513d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
10 changes: 5 additions & 5 deletions src/backend/access/common/fasttab.c
Original file line number Diff line number Diff line change
Expand Up @@ -1187,7 +1187,7 @@ fasttab_insert(Relation relation, HeapTuple tup, HeapTuple heaptup, Oid *result,

if (!import_mode)
{
//CacheInvalidateHeapTuple(relation, dlist_tup->tup, NULL);
CacheInvalidateHeapTuple(relation, dlist_tup->tup, NULL);
pgstat_count_heap_insert(relation, 1);
}

Expand Down Expand Up @@ -1321,7 +1321,7 @@ fasttab_delete(Relation relation, ItemPointer tid)
}

pgstat_count_heap_delete(relation);
// CacheInvalidateHeapTuple(relation, dlist_tup->tup, NULL);
CacheInvalidateHeapTuple(relation, dlist_tup->tup, NULL);

dlist_delete(&dlist_tup->node);
DListHeapTupleFree(dlist_tup);
Expand Down Expand Up @@ -1373,7 +1373,7 @@ fasttab_update(Relation relation, ItemPointer otid, HeapTuple newtup)
{
MemoryContext oldctx = MemoryContextSwitchTo(GetLocalMemoryContext());

// CacheInvalidateHeapTuple(relation, dlist_tup->tup, newtup);
CacheInvalidateHeapTuple(relation, dlist_tup->tup, newtup);
heap_freetuple(dlist_tup->tup);
newtup->t_self = GenFasttabItemPointerData();
dlist_tup->tup = heap_copytuple(newtup);
Expand Down Expand Up @@ -1427,8 +1427,8 @@ fasttab_inplace_update(Relation relation, HeapTuple tuple)
{
MemoryContext oldctx = MemoryContextSwitchTo(GetLocalMemoryContext());

// if (!IsBootstrapProcessingMode())
//CacheInvalidateHeapTuple(relation, tuple, NULL);
if (!IsBootstrapProcessingMode())
CacheInvalidateHeapTuple(relation, tuple, NULL);

heap_freetuple(dlist_tup->tup);
dlist_tup->tup = heap_copytuple(tuple);
Expand Down
7 changes: 6 additions & 1 deletion src/backend/catalog/storage.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,14 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence, char relstorage)
SMgrRelation srel;
BackendId backend;
bool needs_wal;
bool no_error_on_exists;

no_error_on_exists = RELPERSISTENCE_FAST_TEMP == relpersistence;

switch (relpersistence)
{
case RELPERSISTENCE_TEMP:
case RELPERSISTENCE_FAST_TEMP:
case RELPERSISTENCE_TEMP:
backend = TempRelBackendId;
needs_wal = false;
break;
Expand All @@ -105,6 +108,8 @@ RelationCreateStorage(RelFileNode rnode, char relpersistence, char relstorage)
}

srel = smgropen(rnode, backend);
if (no_error_on_exists && srel->smgr->smgr_exists(srel, MAIN_FORKNUM))
return;
smgrcreate(srel, MAIN_FORKNUM, false);

if (needs_wal)
Expand Down

0 comments on commit 4e3513d

Please sign in to comment.