mirror of https://github.com/citusdata/citus.git
Add enable_version_checks GUC and address feedback
parent
1c2056ec74
commit
a09614553f
2
Makefile
2
Makefile
|
@ -20,7 +20,7 @@ install-extension: extension
|
||||||
install-headers: extension
|
install-headers: extension
|
||||||
$(MKDIR_P) '$(DESTDIR)$(includedir_server)/distributed/'
|
$(MKDIR_P) '$(DESTDIR)$(includedir_server)/distributed/'
|
||||||
# generated headers are located in the build directory
|
# generated headers are located in the build directory
|
||||||
$(INSTALL_DATA) $(citus_abs_srcdir)/src/include/citus_config.h '$(DESTDIR)$(includedir_server)/'
|
$(INSTALL_DATA) $(citus_abs_srcdir)/src/include/citus_version.h '$(DESTDIR)$(includedir_server)/'
|
||||||
# the rest in the source tree
|
# the rest in the source tree
|
||||||
$(INSTALL_DATA) $(citus_abs_srcdir)/src/include/distributed/*.h '$(DESTDIR)$(includedir_server)/distributed/'
|
$(INSTALL_DATA) $(citus_abs_srcdir)/src/include/distributed/*.h '$(DESTDIR)$(includedir_server)/distributed/'
|
||||||
clean-extension:
|
clean-extension:
|
||||||
|
|
|
@ -83,7 +83,6 @@
|
||||||
|
|
||||||
bool EnableDDLPropagation = true; /* ddl propagation is enabled */
|
bool EnableDDLPropagation = true; /* ddl propagation is enabled */
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This struct defines the state for the callback for drop statements.
|
* This struct defines the state for the callback for drop statements.
|
||||||
* It is copied as it is from commands/tablecmds.c in Postgres source.
|
* It is copied as it is from commands/tablecmds.c in Postgres source.
|
||||||
|
@ -173,6 +172,7 @@ multi_ProcessUtility(Node *parsetree,
|
||||||
int savedSecurityContext = 0;
|
int savedSecurityContext = 0;
|
||||||
List *ddlJobs = NIL;
|
List *ddlJobs = NIL;
|
||||||
bool extensionStatement = false;
|
bool extensionStatement = false;
|
||||||
|
bool checkExtensionVersion = false;
|
||||||
|
|
||||||
if (IsA(parsetree, TransactionStmt))
|
if (IsA(parsetree, TransactionStmt))
|
||||||
{
|
{
|
||||||
|
@ -193,7 +193,7 @@ multi_ProcessUtility(Node *parsetree,
|
||||||
CreateExtensionStmt *createExtensionStmt = (CreateExtensionStmt *) parsetree;
|
CreateExtensionStmt *createExtensionStmt = (CreateExtensionStmt *) parsetree;
|
||||||
if (strcmp(createExtensionStmt->extname, "citus") == 0)
|
if (strcmp(createExtensionStmt->extname, "citus") == 0)
|
||||||
{
|
{
|
||||||
ErrorIfUnstableCreateOrAlterExtensionStmt(parsetree);
|
checkExtensionVersion = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
extensionStatement = true;
|
extensionStatement = true;
|
||||||
|
@ -204,7 +204,7 @@ multi_ProcessUtility(Node *parsetree,
|
||||||
AlterExtensionStmt *alterExtensionStmt = (AlterExtensionStmt *) parsetree;
|
AlterExtensionStmt *alterExtensionStmt = (AlterExtensionStmt *) parsetree;
|
||||||
if (strcmp(alterExtensionStmt->extname, "citus") == 0)
|
if (strcmp(alterExtensionStmt->extname, "citus") == 0)
|
||||||
{
|
{
|
||||||
ErrorIfUnstableCreateOrAlterExtensionStmt(parsetree);
|
checkExtensionVersion = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
extensionStatement = true;
|
extensionStatement = true;
|
||||||
|
@ -220,18 +220,23 @@ multi_ProcessUtility(Node *parsetree,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (extensionStatement)
|
if (extensionStatement || IsA(parsetree, VariableSetStmt))
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* In CitusHasBeenLoaded check below, we compare binary Citus version,
|
* In CitusHasBeenLoaded check below, we compare binary Citus version,
|
||||||
* extension version and available version. If they are different, we
|
* extension version and available version. If they are different, we
|
||||||
* force user to execute ALTER EXTENSION citus UPDATE. Therefore, if
|
* force user to execute ALTER EXTENSION citus UPDATE. Therefore, we
|
||||||
* user executes ALTER EXTENSION or DROP EXTENSION query we should drop
|
* drop to standard_ProcessUtility earlier for some commands which are
|
||||||
* to the standart utility before CitusHasBeenLoaded check.
|
* safe and necessary to user even in version mismatch situation.
|
||||||
*/
|
*/
|
||||||
standard_ProcessUtility(parsetree, queryString, context,
|
standard_ProcessUtility(parsetree, queryString, context,
|
||||||
params, dest, completionTag);
|
params, dest, completionTag);
|
||||||
|
|
||||||
|
if (EnableVersionChecks && checkExtensionVersion)
|
||||||
|
{
|
||||||
|
ErrorIfUnstableCreateOrAlterExtensionStmt(parsetree);
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1310,7 +1315,7 @@ DeparseVacuumColumnNames(List *columnNameList)
|
||||||
* ErrorIfUnstableCreateOrAlterExtensionStmt compares CITUS_EXTENSIONVERSION
|
* ErrorIfUnstableCreateOrAlterExtensionStmt compares CITUS_EXTENSIONVERSION
|
||||||
* and version given CREATE/ALTER EXTENSION statement will create/update to. If
|
* and version given CREATE/ALTER EXTENSION statement will create/update to. If
|
||||||
* they are not same in major or minor version numbers, this function errors
|
* they are not same in major or minor version numbers, this function errors
|
||||||
* out. It ignores the catalog version.
|
* out. It ignores the schema version.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ErrorIfUnstableCreateOrAlterExtensionStmt(Node *parsetree)
|
ErrorIfUnstableCreateOrAlterExtensionStmt(Node *parsetree)
|
||||||
|
@ -1342,7 +1347,7 @@ ErrorIfUnstableCreateOrAlterExtensionStmt(Node *parsetree)
|
||||||
{
|
{
|
||||||
char *newVersion = strVal(defElement->arg);
|
char *newVersion = strVal(defElement->arg);
|
||||||
|
|
||||||
if (!CompareVersions(newVersion, CITUS_EXTENSIONVERSION))
|
if (!MajorVersionsCompatible(newVersion, CITUS_EXTENSIONVERSION))
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("requested version is not compatible with "
|
ereport(ERROR, (errmsg("requested version is not compatible with "
|
||||||
"loaded Citus binaries.")));
|
"loaded Citus binaries.")));
|
||||||
|
@ -1354,11 +1359,11 @@ ErrorIfUnstableCreateOrAlterExtensionStmt(Node *parsetree)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* new_version is not specified in ALTER EXTENSION statement, PostgreSQL will use
|
* new_version is not specified in ALTER EXTENSION statement, PostgreSQL will use
|
||||||
* default_version from citus.control file. We will flush availableMajorVersion to
|
* default_version from citus.control file. We will flush availableExtensionVersion
|
||||||
* re-check the available version from citus.control file.
|
* to re-check the available version from citus.control file.
|
||||||
*/
|
*/
|
||||||
availableMajorVersion = NULL;
|
availableExtensionVersion = NULL;
|
||||||
ErrorIfNewMajorVersionAvailable();
|
ErrorIfAvailableVersionMismatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -49,7 +49,7 @@
|
||||||
/* marks shared object as one loadable by the postgres version compiled against */
|
/* marks shared object as one loadable by the postgres version compiled against */
|
||||||
PG_MODULE_MAGIC;
|
PG_MODULE_MAGIC;
|
||||||
|
|
||||||
static char *CitusVersion;
|
static char *CitusVersion = CITUS_VERSION;
|
||||||
|
|
||||||
void _PG_init(void);
|
void _PG_init(void);
|
||||||
|
|
||||||
|
@ -623,6 +623,16 @@ RegisterCitusConfigVariables(void)
|
||||||
0,
|
0,
|
||||||
NULL, NULL, NULL);
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
|
DefineCustomBoolVariable(
|
||||||
|
"citus.enable_version_checks",
|
||||||
|
gettext_noop("Enables version checks in CREATE/ALTER extension queries"),
|
||||||
|
NULL,
|
||||||
|
&EnableVersionChecks,
|
||||||
|
true,
|
||||||
|
PGC_USERSET,
|
||||||
|
GUC_NO_SHOW_ALL,
|
||||||
|
NULL, NULL, NULL);
|
||||||
|
|
||||||
/* warn about config items in the citus namespace that are not registered above */
|
/* warn about config items in the citus namespace that are not registered above */
|
||||||
EmitWarningsOnPlaceholders("citus");
|
EmitWarningsOnPlaceholders("citus");
|
||||||
}
|
}
|
||||||
|
|
|
@ -100,8 +100,10 @@ static Oid distTransactionRelationId = InvalidOid;
|
||||||
static Oid distTransactionGroupIndexId = InvalidOid;
|
static Oid distTransactionGroupIndexId = InvalidOid;
|
||||||
static Oid extraDataContainerFuncId = InvalidOid;
|
static Oid extraDataContainerFuncId = InvalidOid;
|
||||||
|
|
||||||
/* Citus installed extension version */
|
/* Citus extension version variables */
|
||||||
char *availableMajorVersion = NULL;
|
bool EnableVersionChecks = true; /* version checks are enabled */
|
||||||
|
|
||||||
|
char *availableExtensionVersion = NULL;
|
||||||
static char *installedExtensionVersion = NULL;
|
static char *installedExtensionVersion = NULL;
|
||||||
|
|
||||||
/* Hash table for informations about each partition */
|
/* Hash table for informations about each partition */
|
||||||
|
@ -139,8 +141,8 @@ static bool HasUniformHashDistribution(ShardInterval **shardIntervalArray,
|
||||||
int shardIntervalArrayLength);
|
int shardIntervalArrayLength);
|
||||||
static bool HasUninitializedShardInterval(ShardInterval **sortedShardIntervalArray,
|
static bool HasUninitializedShardInterval(ShardInterval **sortedShardIntervalArray,
|
||||||
int shardCount);
|
int shardCount);
|
||||||
static void ErrorIfExtensionUpdateNeeded(void);
|
static void ErrorIfInstalledVersionMismatch(void);
|
||||||
static char * AvailableMajorVersion(void);
|
static char * AvailableExtensionVersion(void);
|
||||||
static char * InstalledExtensionVersion(void);
|
static char * InstalledExtensionVersion(void);
|
||||||
static void InitializeDistTableCache(void);
|
static void InitializeDistTableCache(void);
|
||||||
static void InitializeWorkerNodeCache(void);
|
static void InitializeWorkerNodeCache(void);
|
||||||
|
@ -984,8 +986,8 @@ CitusHasBeenLoaded(void)
|
||||||
|
|
||||||
if (extensionLoaded)
|
if (extensionLoaded)
|
||||||
{
|
{
|
||||||
ErrorIfNewMajorVersionAvailable();
|
ErrorIfAvailableVersionMismatch();
|
||||||
ErrorIfExtensionUpdateNeeded();
|
ErrorIfInstalledVersionMismatch();
|
||||||
}
|
}
|
||||||
|
|
||||||
return extensionLoaded;
|
return extensionLoaded;
|
||||||
|
@ -993,16 +995,23 @@ CitusHasBeenLoaded(void)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ErrorIfNewMajorVersionAvailable compares CITUS_EXTENSIONVERSION and currently
|
* ErrorIfAvailableExtensionVersionMismatch compares CITUS_EXTENSIONVERSION and
|
||||||
* available version from citus.control file. If they are not same in major or
|
* currently available version from citus.control file. If they are not same in
|
||||||
* minor version numbers, this function errors out. It ignores the schema version.
|
* major or minor version numbers, this function errors out. It ignores the schema
|
||||||
|
* version.
|
||||||
*/
|
*/
|
||||||
void
|
void
|
||||||
ErrorIfNewMajorVersionAvailable(void)
|
ErrorIfAvailableVersionMismatch(void)
|
||||||
{
|
{
|
||||||
char *availableVersion = AvailableMajorVersion();
|
char *availableVersion = NULL;
|
||||||
|
|
||||||
if (!CompareVersions(availableVersion, CITUS_EXTENSIONVERSION))
|
if (!EnableVersionChecks)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
availableVersion = AvailableExtensionVersion();
|
||||||
|
if (!MajorVersionsCompatible(availableVersion, CITUS_EXTENSIONVERSION))
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("server restart is needed because, loaded Citus binaries "
|
ereport(ERROR, (errmsg("server restart is needed because, loaded Citus binaries "
|
||||||
"does not match the available extension version")));
|
"does not match the available extension version")));
|
||||||
|
@ -1011,16 +1020,23 @@ ErrorIfNewMajorVersionAvailable(void)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* ErrorIfExtensionUpdateNeeded compares CITUS_EXTENSIONVERSION and currently and
|
* ErrorIfInstalledVersionMismatch compares CITUS_EXTENSIONVERSION and currently
|
||||||
* catalog version from pg_extemsion catalog table. If they are not same in major or
|
* and catalog version from pg_extemsion catalog table. If they are not same in
|
||||||
* minor version numbers, this function errors out. It ignores the schema version.
|
* major or minor version numbers, this function errors out. It ignores the schema
|
||||||
|
* version.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ErrorIfExtensionUpdateNeeded(void)
|
ErrorIfInstalledVersionMismatch(void)
|
||||||
{
|
{
|
||||||
char *installedVersion = InstalledExtensionVersion();
|
char *installedVersion = NULL;
|
||||||
|
|
||||||
if (!CompareVersions(installedVersion, CITUS_EXTENSIONVERSION))
|
if (!EnableVersionChecks)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
installedVersion = InstalledExtensionVersion();
|
||||||
|
if (!MajorVersionsCompatible(installedVersion, CITUS_EXTENSIONVERSION))
|
||||||
{
|
{
|
||||||
ereport(ERROR, (errmsg("\"ALTER EXTENSION citus UPDATE;\" is needed, because "
|
ereport(ERROR, (errmsg("\"ALTER EXTENSION citus UPDATE;\" is needed, because "
|
||||||
"loaded Citus binaries does not match the installed "
|
"loaded Citus binaries does not match the installed "
|
||||||
|
@ -1030,36 +1046,55 @@ ErrorIfExtensionUpdateNeeded(void)
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* CompareVersions compares given two versions. If they are same in major and
|
* MajorVersionsCompatible compares given two versions. If they are same in major
|
||||||
* minor version numbers, this function returns true. It ignores the schema version.
|
* and minor version numbers, this function returns true. It ignores the schema
|
||||||
|
* version.
|
||||||
*/
|
*/
|
||||||
bool
|
bool
|
||||||
CompareVersions(char *leftVersion, char *rightVersion)
|
MajorVersionsCompatible(char *leftVersion, char *rightVersion)
|
||||||
{
|
{
|
||||||
const char schemaVersionSeparator = '-';
|
const char schemaVersionSeparator = '-';
|
||||||
char *seperatorPosition = strchr(leftVersion, schemaVersionSeparator);
|
|
||||||
int comparisionLimit = 0;
|
|
||||||
|
|
||||||
if (seperatorPosition != NULL)
|
char *leftSeperatorPosition = strchr(leftVersion, schemaVersionSeparator);
|
||||||
|
char *rightSeperatorPosition = strchr(rightVersion, schemaVersionSeparator);
|
||||||
|
int leftComparisionLimit = 0;
|
||||||
|
int rightComparisionLimit = 0;
|
||||||
|
|
||||||
|
if (leftSeperatorPosition != NULL)
|
||||||
{
|
{
|
||||||
comparisionLimit = seperatorPosition - leftVersion;
|
leftComparisionLimit = leftSeperatorPosition - leftVersion;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
comparisionLimit = strlen(leftVersion);
|
leftComparisionLimit = strlen(leftVersion);
|
||||||
}
|
}
|
||||||
|
|
||||||
return strncmp(leftVersion, rightVersion, comparisionLimit) == 0;
|
if (rightSeperatorPosition != NULL)
|
||||||
|
{
|
||||||
|
rightComparisionLimit = rightSeperatorPosition - rightVersion;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
rightComparisionLimit = strlen(leftVersion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/* we can error out early if hypens are not in the same position */
|
||||||
|
if (leftComparisionLimit != rightComparisionLimit)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return strncmp(leftVersion, rightVersion, leftComparisionLimit) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* AvailableMajorVersion returns the Citus version from citus.control file. It also
|
* AvailableExtensionVersion returns the Citus version from citus.control file. It also
|
||||||
* saves the result, thus consecutive calls to CitusExtensionAvailableVersion will
|
* saves the result, thus consecutive calls to CitusExtensionAvailableVersion will
|
||||||
* not read the citus.control file again.
|
* not read the citus.control file again.
|
||||||
*/
|
*/
|
||||||
static char *
|
static char *
|
||||||
AvailableMajorVersion(void)
|
AvailableExtensionVersion(void)
|
||||||
{
|
{
|
||||||
ReturnSetInfo *extensionsResultSet = NULL;
|
ReturnSetInfo *extensionsResultSet = NULL;
|
||||||
TupleTableSlot *tupleTableSlot = NULL;
|
TupleTableSlot *tupleTableSlot = NULL;
|
||||||
|
@ -1073,9 +1108,9 @@ AvailableMajorVersion(void)
|
||||||
bool doCopy = false;
|
bool doCopy = false;
|
||||||
|
|
||||||
/* if we cached the result before, return it*/
|
/* if we cached the result before, return it*/
|
||||||
if (availableMajorVersion != NULL)
|
if (availableExtensionVersion != NULL)
|
||||||
{
|
{
|
||||||
return availableMajorVersion;
|
return availableExtensionVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
estate = CreateExecutorState();
|
estate = CreateExecutorState();
|
||||||
|
@ -1107,7 +1142,7 @@ AvailableMajorVersion(void)
|
||||||
if (strcmp(extensionName, "citus") == 0)
|
if (strcmp(extensionName, "citus") == 0)
|
||||||
{
|
{
|
||||||
MemoryContext oldMemoryContext = NULL;
|
MemoryContext oldMemoryContext = NULL;
|
||||||
Datum citusVersionDatum = slot_getattr(tupleTableSlot, 2, &isNull);
|
Datum availableVersion = slot_getattr(tupleTableSlot, 2, &isNull);
|
||||||
|
|
||||||
/* we will cache the result of citus version to prevent catalog access */
|
/* we will cache the result of citus version to prevent catalog access */
|
||||||
if (CacheMemoryContext == NULL)
|
if (CacheMemoryContext == NULL)
|
||||||
|
@ -1116,14 +1151,14 @@ AvailableMajorVersion(void)
|
||||||
}
|
}
|
||||||
oldMemoryContext = MemoryContextSwitchTo(CacheMemoryContext);
|
oldMemoryContext = MemoryContextSwitchTo(CacheMemoryContext);
|
||||||
|
|
||||||
availableMajorVersion = text_to_cstring(DatumGetTextPP(citusVersionDatum));
|
availableExtensionVersion = text_to_cstring(DatumGetTextPP(availableVersion));
|
||||||
|
|
||||||
MemoryContextSwitchTo(oldMemoryContext);
|
MemoryContextSwitchTo(oldMemoryContext);
|
||||||
|
|
||||||
ExecClearTuple(tupleTableSlot);
|
ExecClearTuple(tupleTableSlot);
|
||||||
ExecDropSingleTupleTableSlot(tupleTableSlot);
|
ExecDropSingleTupleTableSlot(tupleTableSlot);
|
||||||
|
|
||||||
return availableMajorVersion;
|
return availableExtensionVersion;
|
||||||
}
|
}
|
||||||
|
|
||||||
ExecClearTuple(tupleTableSlot);
|
ExecClearTuple(tupleTableSlot);
|
||||||
|
@ -1177,7 +1212,7 @@ InstalledExtensionVersion(void)
|
||||||
TupleDesc tupleDescriptor = RelationGetDescr(relation);
|
TupleDesc tupleDescriptor = RelationGetDescr(relation);
|
||||||
bool isNull = false;
|
bool isNull = false;
|
||||||
|
|
||||||
Datum extensionVersionDatum = heap_getattr(extensionTuple, extensionIndex,
|
Datum installedVersion = heap_getattr(extensionTuple, extensionIndex,
|
||||||
tupleDescriptor, &isNull);
|
tupleDescriptor, &isNull);
|
||||||
|
|
||||||
if (isNull)
|
if (isNull)
|
||||||
|
@ -1194,8 +1229,7 @@ InstalledExtensionVersion(void)
|
||||||
|
|
||||||
oldMemoryContext = MemoryContextSwitchTo(CacheMemoryContext);
|
oldMemoryContext = MemoryContextSwitchTo(CacheMemoryContext);
|
||||||
|
|
||||||
installedExtensionVersion = text_to_cstring(DatumGetTextPP(
|
installedExtensionVersion = text_to_cstring(DatumGetTextPP(installedVersion));
|
||||||
extensionVersionDatum));
|
|
||||||
|
|
||||||
MemoryContextSwitchTo(oldMemoryContext);
|
MemoryContextSwitchTo(oldMemoryContext);
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,7 +17,8 @@
|
||||||
#include "distributed/worker_manager.h"
|
#include "distributed/worker_manager.h"
|
||||||
#include "utils/hsearch.h"
|
#include "utils/hsearch.h"
|
||||||
|
|
||||||
extern char *availableMajorVersion;
|
extern bool EnableVersionChecks;
|
||||||
|
extern char *availableExtensionVersion;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Representation of a table's metadata that is frequently used for
|
* Representation of a table's metadata that is frequently used for
|
||||||
|
@ -69,8 +70,8 @@ extern void CitusInvalidateRelcacheByRelid(Oid relationId);
|
||||||
extern void CitusInvalidateRelcacheByShardId(int64 shardId);
|
extern void CitusInvalidateRelcacheByShardId(int64 shardId);
|
||||||
|
|
||||||
extern bool CitusHasBeenLoaded(void);
|
extern bool CitusHasBeenLoaded(void);
|
||||||
void ErrorIfNewMajorVersionAvailable(void);
|
void ErrorIfAvailableVersionMismatch(void);
|
||||||
bool CompareVersions(char *leftVersion, char *rightVersion);
|
bool MajorVersionsCompatible(char *leftVersion, char *rightVersion);
|
||||||
|
|
||||||
/* access WorkerNodeHash */
|
/* access WorkerNodeHash */
|
||||||
extern HTAB * GetWorkerNodeHash(void);
|
extern HTAB * GetWorkerNodeHash(void);
|
||||||
|
|
|
@ -13,6 +13,7 @@
|
||||||
#include "tcop/utility.h"
|
#include "tcop/utility.h"
|
||||||
|
|
||||||
extern bool EnableDDLPropagation;
|
extern bool EnableDDLPropagation;
|
||||||
|
extern bool EnableVersionChecks;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A DDLJob encapsulates the remote tasks and commands needed to process all or
|
* A DDLJob encapsulates the remote tasks and commands needed to process all or
|
||||||
|
|
|
@ -24,11 +24,59 @@ WHERE pgd.refclassid = 'pg_extension'::regclass AND
|
||||||
-- DROP EXTENSION pre-created by the regression suite
|
-- DROP EXTENSION pre-created by the regression suite
|
||||||
DROP EXTENSION citus;
|
DROP EXTENSION citus;
|
||||||
\c
|
\c
|
||||||
-- Create extension in oldest version, this is expected to fail
|
SET citus.enable_version_checks TO 'false';
|
||||||
|
-- Create extension in oldest version
|
||||||
CREATE EXTENSION citus VERSION '5.0';
|
CREATE EXTENSION citus VERSION '5.0';
|
||||||
ERROR: requested version is not compatible with loaded Citus binaries.
|
ALTER EXTENSION citus UPDATE TO '5.0-1';
|
||||||
-- Create extension in newest major version, test every upgrade step
|
ALTER EXTENSION citus UPDATE TO '5.0-2';
|
||||||
CREATE EXTENSION citus VERSION '6.2-1';
|
ALTER EXTENSION citus UPDATE TO '5.1-1';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-2';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-3';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-4';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-5';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-6';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-7';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-8';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.2-1';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.2-2';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.2-3';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.2-4';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-1';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-2';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-3';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-4';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-5';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-6';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-7';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-8';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-9';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-10';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-11';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-12';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-13';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-14';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-15';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-16';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-17';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-18';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-1';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-2';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-3';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-4';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-5';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-6';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-7';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-8';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-9';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-10';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-11';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-12';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-13';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-14';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-15';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-16';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-17';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.2-1';
|
||||||
ALTER EXTENSION citus UPDATE TO '6.2-2';
|
ALTER EXTENSION citus UPDATE TO '6.2-2';
|
||||||
-- show running version
|
-- show running version
|
||||||
SHOW citus.version;
|
SHOW citus.version;
|
||||||
|
@ -51,7 +99,11 @@ WHERE pgd.refclassid = 'pg_extension'::regclass AND
|
||||||
0
|
0
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
-- drop extension an re-create in newest version
|
-- see incompatible version errors out
|
||||||
DROP EXTENSION citus;
|
DROP EXTENSION citus;
|
||||||
\c
|
\c
|
||||||
|
CREATE EXTENSION citus VERSION '5.0';
|
||||||
|
ERROR: requested version is not compatible with loaded Citus binaries.
|
||||||
|
-- re-create in newest version
|
||||||
|
\c
|
||||||
CREATE EXTENSION citus;
|
CREATE EXTENSION citus;
|
||||||
|
|
|
@ -24,11 +24,60 @@ WHERE pgd.refclassid = 'pg_extension'::regclass AND
|
||||||
DROP EXTENSION citus;
|
DROP EXTENSION citus;
|
||||||
\c
|
\c
|
||||||
|
|
||||||
-- Create extension in oldest version, this is expected to fail
|
SET citus.enable_version_checks TO 'false';
|
||||||
CREATE EXTENSION citus VERSION '5.0';
|
|
||||||
|
|
||||||
-- Create extension in newest major version, test every upgrade step
|
-- Create extension in oldest version
|
||||||
CREATE EXTENSION citus VERSION '6.2-1';
|
CREATE EXTENSION citus VERSION '5.0';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.0-1';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.0-2';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-1';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-2';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-3';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-4';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-5';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-6';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-7';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.1-8';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.2-1';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.2-2';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.2-3';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '5.2-4';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-1';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-2';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-3';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-4';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-5';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-6';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-7';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-8';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-9';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-10';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-11';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-12';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-13';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-14';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-15';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-16';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-17';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.0-18';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-1';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-2';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-3';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-4';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-5';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-6';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-7';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-8';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-9';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-10';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-11';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-12';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-13';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-14';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-15';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-16';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.1-17';
|
||||||
|
ALTER EXTENSION citus UPDATE TO '6.2-1';
|
||||||
ALTER EXTENSION citus UPDATE TO '6.2-2';
|
ALTER EXTENSION citus UPDATE TO '6.2-2';
|
||||||
|
|
||||||
-- show running version
|
-- show running version
|
||||||
|
@ -44,7 +93,11 @@ WHERE pgd.refclassid = 'pg_extension'::regclass AND
|
||||||
pge.extname = 'citus' AND
|
pge.extname = 'citus' AND
|
||||||
pgio.schema NOT IN ('pg_catalog', 'citus');
|
pgio.schema NOT IN ('pg_catalog', 'citus');
|
||||||
|
|
||||||
-- drop extension an re-create in newest version
|
-- see incompatible version errors out
|
||||||
DROP EXTENSION citus;
|
DROP EXTENSION citus;
|
||||||
\c
|
\c
|
||||||
|
CREATE EXTENSION citus VERSION '5.0';
|
||||||
|
|
||||||
|
-- re-create in newest version
|
||||||
|
\c
|
||||||
CREATE EXTENSION citus;
|
CREATE EXTENSION citus;
|
||||||
|
|
Loading…
Reference in New Issue