Define symbols required for downgrade from 11.1 (#6301)

Since #6300/e29db74 changed the C symbol that our bigint overrides of
pg_cancel_backend and pg_terminate_backend called. We needed to do
something to continue to make these functions work after downgrading.

Recreating the old definition with a downgrade scripts is not really
possible, since people are expected to run the downgrade steps when
using the new .so file, which does not contain the old symbols.

So, the easiest way to solve it was also defining the new symbols in our
old Citus versions. Luckily our overrides haven't existed for long, so
these symbol definitions only needed to be backported to 11.0.
pull/6302/head
Jelte Fennema 2022-09-07 12:18:39 +02:00 committed by GitHub
parent 5f57d77899
commit 75cf7a748d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 26 additions and 0 deletions

View File

@ -24,6 +24,8 @@ static bool CitusSignalBackend(uint64 globalPID, uint64 timeout, int sig);
PG_FUNCTION_INFO_V1(pg_cancel_backend);
PG_FUNCTION_INFO_V1(pg_terminate_backend);
PG_FUNCTION_INFO_V1(citus_cancel_backend);
PG_FUNCTION_INFO_V1(citus_terminate_backend);
/*
* pg_cancel_backend overrides the Postgres' pg_cancel_backend to cancel
@ -48,6 +50,18 @@ pg_cancel_backend(PG_FUNCTION_ARGS)
}
/*
* citus_cancel_backend is needed to make the pg_cancel_backend SQL function
* still work after downgrading from 11.1, which changed its definition to call
* a different symbol. See #6300/e29db74 for details.
*/
Datum
citus_cancel_backend(PG_FUNCTION_ARGS)
{
return pg_cancel_backend(fcinfo);
}
/*
* pg_terminate_backend overrides the Postgres' pg_terminate_backend to terminate
* a query with a global pid so a query can be terminated from another node.
@ -71,6 +85,18 @@ pg_terminate_backend(PG_FUNCTION_ARGS)
}
/*
* citus_terminate_backend is needed to make the pg_terminate_backend SQL
* function still work after downgrading from 11.1, which changed its
* definition to call a different symbol. See #6300/e29db74 for details
*/
Datum
citus_terminate_backend(PG_FUNCTION_ARGS)
{
return pg_terminate_backend(fcinfo);
}
/*
* CitusSignalBackend gets a global pid and and ends the original query with the global pid
* that might have started in another node by connecting to that node and running either