mirror of
https://github.com/neondatabase/neon.git
synced 2025-12-27 16:12:56 +00:00
## Problem See https://github.com/neondatabase/neon/issues/11910 and https://neondb.slack.com/archives/C04DGM6SMTM/p1747314649059129 ## Summary of changes Do not change persistence in `start_unlogged_build` Postgres PRs: https://github.com/neondatabase/postgres/pull/642 https://github.com/neondatabase/postgres/pull/641 https://github.com/neondatabase/postgres/pull/640 https://github.com/neondatabase/postgres/pull/639 --------- Co-authored-by: Konstantin Knizhnik <knizhnik@neon.tech>
38 lines
1.1 KiB
Diff
38 lines
1.1 KiB
Diff
diff --git a/src/ruminsert.c b/src/ruminsert.c
|
|
index 255e616..1c6edb7 100644
|
|
--- a/src/ruminsert.c
|
|
+++ b/src/ruminsert.c
|
|
@@ -628,6 +628,10 @@ rumbuild(Relation heap, Relation index, struct IndexInfo *indexInfo)
|
|
elog(ERROR, "index \"%s\" already contains data",
|
|
RelationGetRelationName(index));
|
|
|
|
+#ifdef NEON_SMGR
|
|
+ smgr_start_unlogged_build(RelationGetSmgr(index));
|
|
+#endif
|
|
+
|
|
initRumState(&buildstate.rumstate, index);
|
|
buildstate.rumstate.isBuild = true;
|
|
buildstate.indtuples = 0;
|
|
@@ -693,6 +697,10 @@ rumbuild(Relation heap, Relation index, struct IndexInfo *indexInfo)
|
|
buildstate.buildStats.nTotalPages = RelationGetNumberOfBlocks(index);
|
|
rumUpdateStats(index, &buildstate.buildStats, buildstate.rumstate.isBuild);
|
|
|
|
+#ifdef NEON_SMGR
|
|
+ smgr_finish_unlogged_build_phase_1(RelationGetSmgr(index));
|
|
+#endif
|
|
+
|
|
/*
|
|
* Write index to xlog
|
|
*/
|
|
@@ -713,6 +721,10 @@ rumbuild(Relation heap, Relation index, struct IndexInfo *indexInfo)
|
|
UnlockReleaseBuffer(buffer);
|
|
}
|
|
|
|
+#ifdef NEON_SMGR
|
|
+ smgr_end_unlogged_build(RelationGetSmgr(index));
|
|
+#endif
|
|
+
|
|
/*
|
|
* Return statistics
|
|
*/
|