From 03c99a9fea4516fb9ebebce123a0271dc8d5e3f3 Mon Sep 17 00:00:00 2001 From: reshke Date: Tue, 13 Jan 2026 19:52:55 +0000 Subject: [PATCH] Use smgrAO iface where appropriate. Grennplum uses smgr proxy feature to allow hijacking execution flow of AO/AOCS relation storage interaction. Use that, instead of plain FileSomething functions. --- src/backend/cdb/cdbappendonlystoragewrite.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backend/cdb/cdbappendonlystoragewrite.c b/src/backend/cdb/cdbappendonlystoragewrite.c index fe99836f02f..6a17e1cdd0f 100755 --- a/src/backend/cdb/cdbappendonlystoragewrite.c +++ b/src/backend/cdb/cdbappendonlystoragewrite.c @@ -410,14 +410,14 @@ AppendOnlyStorageWrite_FlushAndCloseFile( * primary. Temp tables are not crash safe, no need to fsync them. */ if (!RelFileNodeBackendIsTemp(storageWrite->relFileNode) && - FileSync(storageWrite->file, WAIT_EVENT_DATA_FILE_SYNC) != 0) + storageWrite->smgrAO->smgr_FileSync(storageWrite->file, WAIT_EVENT_DATA_FILE_SYNC) != 0) ereport(ERROR, (errcode_for_file_access(), errmsg("Could not flush (fsync) Append-Only segment file '%s' to disk for relation '%s': %m", storageWrite->segmentFileName, storageWrite->relationName))); - FileClose(storageWrite->file); + storageWrite->smgrAO->smgr_FileClose(storageWrite->file); storageWrite->file = -1; storageWrite->formatVersion = -1;