Re: should frontend tools use syncfs() ?

Поиск
Список
Период
Сортировка
От Maxim Orlov
Тема Re: should frontend tools use syncfs() ?
Дата
Msg-id CACG=ezbL1gwE7_K7sr9uqaCGkWhmvRTcTEnm3+X1xsRNwbXULQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: should frontend tools use syncfs() ?  (Nathan Bossart <nathandbossart@gmail.com>)
Ответы Re: should frontend tools use syncfs() ?  (Nathan Bossart <nathandbossart@gmail.com>)
Список pgsql-hackers
On Thu, 7 Sept 2023 at 03:34, Nathan Bossart <nathandbossart@gmail.com> wrote:
Committed.

Hi! Great job!

But here is one problem I've encountered during working on some unrelated stuff.
How we have two different things call the same name – sync_method. One in xlog:
int            sync_method = DEFAULT_SYNC_METHOD;
...and another one in "bins":
static DataDirSyncMethod sync_method = DATA_DIR_SYNC_METHOD_FSYNC;

In current include order, this is not a problem, but imagine you add a couple of new includes,
for example:
--- a/src/include/storage/bufpage.h
+++ b/src/include/storage/bufpage.h
@@ -18,6 +18,8 @@
 #include "storage/block.h"
 #include "storage/item.h"
 #include "storage/off.h"
+#include "postgres.h"
+#include "utils/rel.h"

And build will be broken, because we how have two different things called "sync_method" with
different types:
In file included from .../src/bin/pg_rewind/pg_rewind.c:33:
In file included from .../src/include/storage/bufpage.h:22:
In file included from .../src/include/utils/rel.h:18:
.../src/include/access/xlog.h:27:24: error: redeclaration of 'sync_method' with a different type: 'int' vs 'DataDirSyncMethod' (aka 'enum DataDirSyncMethod')
extern PGDLLIMPORT int sync_method;
...

As a solution, I suggest renaming sync_method in xlog module to wal_sync_method. In fact,
appropriate GUC for this variable, called "wal_sync_method" and I see no reason not to use
the exact same name for a variable in xlog module.

--
Best regards,
Maxim Orlov.
Вложения

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Dean Rasheed
Дата:
Сообщение: Re: Infinite Interval
Следующее
От: Dean Rasheed
Дата:
Сообщение: Re: Infinite Interval