remove stormutils, containing only stormdb_promote_standby() function
authorTomas Vondra <[email protected]>
Wed, 24 Aug 2016 10:40:05 +0000 (12:40 +0200)
committerPavan Deolasee <[email protected]>
Thu, 1 Sep 2016 05:14:17 +0000 (10:44 +0530)
Although stormdb_promote_standby() is a function visible from SQL,
it does not seem mentioned anywhere (e.g. in the docs etc.). So
let's get rid of it, as it's apparently not needed.

src/backend/pgxc/cluster/Makefile
src/backend/pgxc/cluster/stormutils.c [deleted file]
src/include/catalog/pg_proc.h
src/include/utils/builtins.h

index 85c1d493f04ff4e58f905f2c9fb9a753c3debf84..f1283ec3d5856937b12993917fc253bcf4347541 100644 (file)
@@ -12,6 +12,6 @@ subdir = src/backend/pgxc/cluster
 top_builddir = ../../../..
 include $(top_builddir)/src/Makefile.global
 
-OBJS = pause.o stormutils.o
+OBJS = pause.o
 
 include $(top_srcdir)/src/backend/common.mk
diff --git a/src/backend/pgxc/cluster/stormutils.c b/src/backend/pgxc/cluster/stormutils.c
deleted file mode 100644 (file)
index 26b00d4..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*-------------------------------------------------------------------------
- *
- * stormutils.c
- *
- * Miscellaneous util functions
- *
- * IDENTIFICATION
- *       $$
- *
- *-------------------------------------------------------------------------
- */
-
-#ifdef XCP
-#include "postgres.h"
-#include "miscadmin.h"
-
-#include "utils/builtins.h"
-#include "../interfaces/libpq/libpq-fe.h"
-#include "commands/dbcommands.h"
-
-/*
- * stormdb_promote_standby:
- *
- * Promote a standby into a regular backend by touching the trigger file. We
- * cannot do it from outside via a normal shell script because this function
- * needs to be called in context of the operation that is moving the node.
- * Providing a function call provides some sense of transactional atomicity
- */
-Datum
-stormdb_promote_standby(PG_FUNCTION_ARGS)
-{
-       char            trigger_file[MAXPGPATH];
-       FILE            *fp;
-
-       snprintf(trigger_file, MAXPGPATH, "%s/stormdb.failover", DataDir);
-
-       if ((fp = fopen(trigger_file, "w")) == NULL)
-               ereport(ERROR,
-                               (errmsg("could not create trigger file"),
-                                errdetail("The trigger file path was: %s",
-                                                  trigger_file)));
-       fclose(fp);
-
-       PG_RETURN_VOID();
-}
-#endif
index 553bf8d59300e512c37348b4d4ba7c1f7751a58c..37cd5022e7d4e6bbcaa0a728357e1513fc62f6ca 100644 (file)
@@ -5300,10 +5300,6 @@ DATA(insert OID = 7024 (  pgxc_is_inprogress     PGNSP PGUID 12 1 1 0 0 f f f f t t
 DESCR("is given GXID in progress?");
 DATA(insert OID = 7011 ( pgxc_lock_for_backup PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 16 "" _null_ _null_ _null_ _null_ _null_ pgxc_lock_for_backup _null_ _null_ _null_ ));
 DESCR("lock the cluster for taking backup");
-#ifdef XCP
-DATA(insert OID = 7012 ( stormdb_promote_standby       PGNSP PGUID 12 1 0 0 0 f f f f t f v 0 0 2278 "" _null_ _null_ _null_ _null_ _null_ stormdb_promote_standby _null_ _null_ _null_ ));
-DESCR("touch trigger file on a standby machine to end replication");
-#endif
 DATA(insert OID = 7014 ( numeric_agg_state_in                          PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 7018 "2275" _null_ _null_ _null_ _null_ _null_ numeric_agg_state_in _null_ _null_ _null_ ));
 DESCR("I/O");
 DATA(insert OID = 7015 ( numeric_agg_state_out                 PGNSP PGUID 12 1 0 0 0 f f f f t f i 1 0 2275 "7018" _null_ _null_ _null_ _null_ _null_ numeric_agg_state_out _null_ _null_ _null_ ));
index 8a4fb07940e4e118a636fe4fa15a6c171de6dcb6..be35f29dfcfab9e5539aa3f72e8082177c8f0b60 100644 (file)
@@ -1320,9 +1320,6 @@ extern Datum pg_cursor(PG_FUNCTION_ARGS);
 extern Datum pgxc_pool_check(PG_FUNCTION_ARGS);
 extern Datum pgxc_pool_reload(PG_FUNCTION_ARGS);
 
-/* backend/pgxc/cluster/stormutils.c */
-extern Datum stormdb_promote_standby(PG_FUNCTION_ARGS);
-
 /* backend/access/transam/transam.c */
 extern Datum pgxc_is_committed(PG_FUNCTION_ARGS);
 extern Datum pgxc_is_inprogress(PG_FUNCTION_ARGS);