From 8c91a9f56a20577048b316be4692ed49a3699465 Mon Sep 17 00:00:00 2001 From: Andrew Kane Date: Mon, 10 Jun 2024 21:55:17 -0700 Subject: [PATCH] Fixed initialization fork for IVFFlat indexes on unlogged tables - #591 --- CHANGELOG.md | 2 +- src/ivfbuild.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 771a4e6..9c49ef3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,6 @@ ## 0.7.2 (unreleased) -- Fixed initialization fork for HNSW indexes on unlogged tables +- Fixed initialization fork for indexes on unlogged tables ## 0.7.1 (2024-06-03) diff --git a/src/ivfbuild.c b/src/ivfbuild.c index cfff09d..cfc30fc 100644 --- a/src/ivfbuild.c +++ b/src/ivfbuild.c @@ -1006,6 +1006,10 @@ BuildIndex(Relation heap, Relation index, IndexInfo *indexInfo, CreateListPages(index, buildstate->centers, buildstate->dimensions, buildstate->lists, forkNum, &buildstate->listInfo); CreateEntryPages(buildstate, forkNum); + /* GenericXLog functions skip unlogged tables */ + if (forkNum == INIT_FORKNUM) + log_newpage_range(index, forkNum, 0, RelationGetNumberOfBlocksInFork(index, forkNum), true); + FreeBuildState(buildstate); }