diff options
author | Michael Paquier <michael@paquier.xyz> | 2023-01-25 14:36:51 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2023-01-25 14:36:51 +0900 |
commit | 0ad3c60caf5f77edfefaf8850fbba5ea4fe28640 (patch) | |
tree | 0edd80514358104a8ac00ca35f23e5b4f69219ef /contrib | |
parent | 239b1753421ccbd52f4f628a9265c3034d38b80f (diff) | |
download | postgresql-0ad3c60caf5f77edfefaf8850fbba5ea4fe28640.tar.gz |
Rename contrib module basic_archive to basic_wal_module
This rename is in preparation for the introduction of recovery modules,
where basic_wal_module will be used as a base template for the set of
callbacks introduced. The former name did not really reflect all that.
Author: Nathan Bossart
Discussion: https://postgr.es/m/20221227192449.GA3672473@nathanxps13
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/Makefile | 2 | ||||
-rw-r--r-- | contrib/basic_archive/basic_archive.conf | 4 | ||||
-rw-r--r-- | contrib/basic_archive/meson.build | 34 | ||||
-rw-r--r-- | contrib/basic_wal_module/.gitignore (renamed from contrib/basic_archive/.gitignore) | 0 | ||||
-rw-r--r-- | contrib/basic_wal_module/Makefile (renamed from contrib/basic_archive/Makefile) | 14 | ||||
-rw-r--r-- | contrib/basic_wal_module/basic_wal_module.c (renamed from contrib/basic_archive/basic_archive.c) | 26 | ||||
-rw-r--r-- | contrib/basic_wal_module/basic_wal_module.conf | 4 | ||||
-rw-r--r-- | contrib/basic_wal_module/expected/basic_wal_module.out (renamed from contrib/basic_archive/expected/basic_archive.out) | 0 | ||||
-rw-r--r-- | contrib/basic_wal_module/meson.build | 34 | ||||
-rw-r--r-- | contrib/basic_wal_module/sql/basic_wal_module.sql (renamed from contrib/basic_archive/sql/basic_archive.sql) | 0 | ||||
-rw-r--r-- | contrib/meson.build | 2 |
11 files changed, 60 insertions, 60 deletions
diff --git a/contrib/Makefile b/contrib/Makefile index bbf220407b..98acaf8690 100644 --- a/contrib/Makefile +++ b/contrib/Makefile @@ -9,7 +9,7 @@ SUBDIRS = \ amcheck \ auth_delay \ auto_explain \ - basic_archive \ + basic_wal_module \ basebackup_to_shell \ bloom \ btree_gin \ diff --git a/contrib/basic_archive/basic_archive.conf b/contrib/basic_archive/basic_archive.conf deleted file mode 100644 index 7c82a4b82b..0000000000 --- a/contrib/basic_archive/basic_archive.conf +++ /dev/null @@ -1,4 +0,0 @@ -archive_mode = on -archive_library = 'basic_archive' -basic_archive.archive_directory = '.' -wal_level = replica diff --git a/contrib/basic_archive/meson.build b/contrib/basic_archive/meson.build deleted file mode 100644 index bc1380e6f6..0000000000 --- a/contrib/basic_archive/meson.build +++ /dev/null @@ -1,34 +0,0 @@ -# Copyright (c) 2022-2023, PostgreSQL Global Development Group - -basic_archive_sources = files( - 'basic_archive.c', -) - -if host_system == 'windows' - basic_archive_sources += rc_lib_gen.process(win32ver_rc, extra_args: [ - '--NAME', 'basic_archive', - '--FILEDESC', 'basic_archive - basic archive module',]) -endif - -basic_archive = shared_module('basic_archive', - basic_archive_sources, - kwargs: contrib_mod_args, -) -contrib_targets += basic_archive - -tests += { - 'name': 'basic_archive', - 'sd': meson.current_source_dir(), - 'bd': meson.current_build_dir(), - 'regress': { - 'sql': [ - 'basic_archive', - ], - 'regress_args': [ - '--temp-config', files('basic_archive.conf'), - ], - # Disabled because these tests require "shared_preload_libraries=basic_archive", - # which typical runningcheck users do not have (e.g. buildfarm clients). - 'runningcheck': false, - }, -} diff --git a/contrib/basic_archive/.gitignore b/contrib/basic_wal_module/.gitignore index 5dcb3ff972..5dcb3ff972 100644 --- a/contrib/basic_archive/.gitignore +++ b/contrib/basic_wal_module/.gitignore diff --git a/contrib/basic_archive/Makefile b/contrib/basic_wal_module/Makefile index 55d299d650..1f88aaf469 100644 --- a/contrib/basic_archive/Makefile +++ b/contrib/basic_wal_module/Makefile @@ -1,11 +1,11 @@ -# contrib/basic_archive/Makefile +# contrib/basic_wal_module/Makefile -MODULES = basic_archive -PGFILEDESC = "basic_archive - basic archive module" +MODULES = basic_wal_module +PGFILEDESC = "basic_wal_module - basic write-ahead log module" -REGRESS = basic_archive -REGRESS_OPTS = --temp-config $(top_srcdir)/contrib/basic_archive/basic_archive.conf -# Disabled because these tests require "shared_preload_libraries=basic_archive", +REGRESS = basic_wal_module +REGRESS_OPTS = --temp-config $(top_srcdir)/contrib/basic_wal_module/basic_wal_module.conf +# Disabled because these tests require "shared_preload_libraries=basic_wal_module", # which typical installcheck users do not have (e.g. buildfarm clients). NO_INSTALLCHECK = 1 @@ -14,7 +14,7 @@ PG_CONFIG = pg_config PGXS := $(shell $(PG_CONFIG) --pgxs) include $(PGXS) else -subdir = contrib/basic_archive +subdir = contrib/basic_wal_module top_builddir = ../.. include $(top_builddir)/src/Makefile.global include $(top_srcdir)/contrib/contrib-global.mk diff --git a/contrib/basic_archive/basic_archive.c b/contrib/basic_wal_module/basic_wal_module.c index 3d29711a31..78c36656a8 100644 --- a/contrib/basic_archive/basic_archive.c +++ b/contrib/basic_wal_module/basic_wal_module.c @@ -1,6 +1,6 @@ /*------------------------------------------------------------------------- * - * basic_archive.c + * basic_wal_module.c * * This file demonstrates a basic archive library implementation that is * roughly equivalent to the following shell command: @@ -20,7 +20,7 @@ * Copyright (c) 2022-2023, PostgreSQL Global Development Group * * IDENTIFICATION - * contrib/basic_archive/basic_archive.c + * contrib/basic_wal_module/basic_wal_module.c * *------------------------------------------------------------------------- */ @@ -41,7 +41,7 @@ PG_MODULE_MAGIC; static char *archive_directory = NULL; -static MemoryContext basic_archive_context; +static MemoryContext basic_wal_module_context; static bool basic_archive_configured(void); static bool basic_archive_file(const char *file, const char *path); @@ -57,7 +57,7 @@ static bool compare_files(const char *file1, const char *file2); void _PG_init(void) { - DefineCustomStringVariable("basic_archive.archive_directory", + DefineCustomStringVariable("basic_wal_module.archive_directory", gettext_noop("Archive file destination directory."), NULL, &archive_directory, @@ -66,11 +66,11 @@ _PG_init(void) 0, check_archive_directory, NULL, NULL); - MarkGUCPrefixReserved("basic_archive"); + MarkGUCPrefixReserved("basic_wal_module"); - basic_archive_context = AllocSetContextCreate(TopMemoryContext, - "basic_archive", - ALLOCSET_DEFAULT_SIZES); + basic_wal_module_context = AllocSetContextCreate(TopMemoryContext, + "basic_wal_module", + ALLOCSET_DEFAULT_SIZES); } /* @@ -156,7 +156,7 @@ basic_archive_file(const char *file, const char *path) * we can easily reset it during error recovery (thus avoiding memory * leaks). */ - oldcontext = MemoryContextSwitchTo(basic_archive_context); + oldcontext = MemoryContextSwitchTo(basic_wal_module_context); /* * Since the archiver operates at the bottom of the exception stack, @@ -183,7 +183,7 @@ basic_archive_file(const char *file, const char *path) /* Reset our memory context and switch back to the original one */ MemoryContextSwitchTo(oldcontext); - MemoryContextReset(basic_archive_context); + MemoryContextReset(basic_wal_module_context); /* Remove our exception handler */ PG_exception_stack = NULL; @@ -206,7 +206,7 @@ basic_archive_file(const char *file, const char *path) /* Reset our memory context and switch back to the original one */ MemoryContextSwitchTo(oldcontext); - MemoryContextReset(basic_archive_context); + MemoryContextReset(basic_wal_module_context); return true; } @@ -221,7 +221,7 @@ basic_archive_file_internal(const char *file, const char *path) uint64 epoch; /* milliseconds */ ereport(DEBUG3, - (errmsg("archiving \"%s\" via basic_archive", file))); + (errmsg("archiving \"%s\" via basic_wal_module", file))); snprintf(destination, MAXPGPATH, "%s/%s", archive_directory, file); @@ -285,7 +285,7 @@ basic_archive_file_internal(const char *file, const char *path) (void) durable_rename(temp, destination, ERROR); ereport(DEBUG1, - (errmsg("archived \"%s\" via basic_archive", file))); + (errmsg("archived \"%s\" via basic_wal_module", file))); } /* diff --git a/contrib/basic_wal_module/basic_wal_module.conf b/contrib/basic_wal_module/basic_wal_module.conf new file mode 100644 index 0000000000..9a4ffacf68 --- /dev/null +++ b/contrib/basic_wal_module/basic_wal_module.conf @@ -0,0 +1,4 @@ +archive_mode = on +archive_library = 'basic_wal_module' +basic_wal_module.archive_directory = '.' +wal_level = replica diff --git a/contrib/basic_archive/expected/basic_archive.out b/contrib/basic_wal_module/expected/basic_wal_module.out index 0015053e0f..0015053e0f 100644 --- a/contrib/basic_archive/expected/basic_archive.out +++ b/contrib/basic_wal_module/expected/basic_wal_module.out diff --git a/contrib/basic_wal_module/meson.build b/contrib/basic_wal_module/meson.build new file mode 100644 index 0000000000..59939d71c4 --- /dev/null +++ b/contrib/basic_wal_module/meson.build @@ -0,0 +1,34 @@ +# Copyright (c) 2022-2023, PostgreSQL Global Development Group + +basic_wal_module_sources = files( + 'basic_wal_module.c', +) + +if host_system == 'windows' + basic_wal_module_sources += rc_lib_gen.process(win32ver_rc, extra_args: [ + '--NAME', 'basic_wal_module', + '--FILEDESC', 'basic_wal_module - basic write-ahead log module',]) +endif + +basic_wal_module = shared_module('basic_wal_module', + basic_wal_module_sources, + kwargs: contrib_mod_args, +) +contrib_targets += basic_wal_module + +tests += { + 'name': 'basic_wal_module', + 'sd': meson.current_source_dir(), + 'bd': meson.current_build_dir(), + 'regress': { + 'sql': [ + 'basic_wal_module', + ], + 'regress_args': [ + '--temp-config', files('basic_wal_module.conf'), + ], + # Disabled because these tests require "shared_preload_libraries=basic_wal_module", + # which typical runningcheck users do not have (e.g. buildfarm clients). + 'runningcheck': false, + }, +} diff --git a/contrib/basic_archive/sql/basic_archive.sql b/contrib/basic_wal_module/sql/basic_wal_module.sql index 14e236d57a..14e236d57a 100644 --- a/contrib/basic_archive/sql/basic_archive.sql +++ b/contrib/basic_wal_module/sql/basic_wal_module.sql diff --git a/contrib/meson.build b/contrib/meson.build index bd4a57c43c..2db77a18d7 100644 --- a/contrib/meson.build +++ b/contrib/meson.build @@ -11,7 +11,7 @@ subdir('adminpack') subdir('amcheck') subdir('auth_delay') subdir('auto_explain') -subdir('basic_archive') +subdir('basic_wal_module') subdir('bloom') subdir('basebackup_to_shell') subdir('bool_plperl') |