From 7fab05d27a903cb1131f5ee8edafc3c44f3eba6e Mon Sep 17 00:00:00 2001 From: Hanefi Onaldi Date: Mon, 23 Jan 2023 22:22:39 +0300 Subject: [PATCH] Install downgrade scripts by default. This commit removes downgrades/ folders and merges their contents with their parents. --- CONTRIBUTING.md | 6 - Makefile | 11 +- ci/build-citus.sh | 2 +- gucs_in_citus.out | 121 ++++++++++++++++++ src/backend/columnar/Makefile | 4 +- .../citus--11.0-3--11.0-2.sql | 0 .../citus_columnar--11.1-1--11.1-0.sql | 0 .../citus_columnar--11.2-1--11.1-1.sql | 0 .../columnar--10.0-1--9.5-1.sql | 0 .../columnar--10.0-2--10.0-1.sql | 0 .../columnar--10.1-1--10.0-3.sql | 2 +- .../columnar--10.2-1--10.1-1.sql | 0 .../columnar--10.2-2--10.2-1.sql | 0 .../columnar--10.2-3--10.2-2.sql | 0 .../columnar--10.2-4--10.2-3.sql | 0 .../columnar--11.1-1--11.0-3.sql | 6 +- src/backend/distributed/Makefile | 19 +-- .../{downgrades => }/citus--10.0-4--9.5-1.sql | 32 ++--- .../citus--10.1-1--10.0-4.sql | 14 +- .../citus--10.2-1--10.1-1.sql | 4 +- .../distributed/sql/citus--10.2-2--10.2-1.sql | 3 + .../distributed/sql/citus--10.2-3--10.2-2.sql | 3 + .../citus--10.2-4--10.2-3.sql | 4 +- .../citus--11.0-1--10.2-4.sql | 6 +- .../citus--11.0-2--11.0-1.sql | 6 +- .../distributed/sql/citus--11.0-3--11.0-2.sql | 1 + .../citus--11.1-1--11.0-4.sql | 14 +- .../citus--11.2-1--11.1-1.sql | 12 +- .../{downgrades => }/citus--9.2-4--9.2-2.sql | 0 .../{downgrades => }/citus--9.3-2--9.2-4.sql | 0 .../{downgrades => }/citus--9.4-1--9.3-2.sql | 0 .../{downgrades => }/citus--9.5-1--9.4-1.sql | 2 +- .../sql/downgrades/citus--10.2-2--10.2-1.sql | 3 - .../sql/downgrades/citus--10.2-3--10.2-2.sql | 3 - .../sql/downgrades/citus--11.0-3--11.0-2.sql | 1 - 35 files changed, 185 insertions(+), 94 deletions(-) create mode 100644 gucs_in_citus.out rename src/backend/columnar/sql/{downgrades => }/citus--11.0-3--11.0-2.sql (100%) rename src/backend/columnar/sql/{downgrades => }/citus_columnar--11.1-1--11.1-0.sql (100%) rename src/backend/columnar/sql/{downgrades => }/citus_columnar--11.2-1--11.1-1.sql (100%) rename src/backend/columnar/sql/{downgrades => }/columnar--10.0-1--9.5-1.sql (100%) rename src/backend/columnar/sql/{downgrades => }/columnar--10.0-2--10.0-1.sql (100%) rename src/backend/columnar/sql/{downgrades => }/columnar--10.1-1--10.0-3.sql (88%) rename src/backend/columnar/sql/{downgrades => }/columnar--10.2-1--10.1-1.sql (100%) rename src/backend/columnar/sql/{downgrades => }/columnar--10.2-2--10.2-1.sql (100%) rename src/backend/columnar/sql/{downgrades => }/columnar--10.2-3--10.2-2.sql (100%) rename src/backend/columnar/sql/{downgrades => }/columnar--10.2-4--10.2-3.sql (100%) rename src/backend/columnar/sql/{downgrades => }/columnar--11.1-1--11.0-3.sql (71%) rename src/backend/distributed/sql/{downgrades => }/citus--10.0-4--9.5-1.sql (93%) rename src/backend/distributed/sql/{downgrades => }/citus--10.1-1--10.0-4.sql (88%) rename src/backend/distributed/sql/{downgrades => }/citus--10.2-1--10.1-1.sql (94%) create mode 100644 src/backend/distributed/sql/citus--10.2-2--10.2-1.sql create mode 100644 src/backend/distributed/sql/citus--10.2-3--10.2-2.sql rename src/backend/distributed/sql/{downgrades => }/citus--10.2-4--10.2-3.sql (78%) rename src/backend/distributed/sql/{downgrades => }/citus--11.0-1--10.2-4.sql (99%) rename src/backend/distributed/sql/{downgrades => }/citus--11.0-2--11.0-1.sql (80%) create mode 100644 src/backend/distributed/sql/citus--11.0-3--11.0-2.sql rename src/backend/distributed/sql/{downgrades => }/citus--11.1-1--11.0-4.sql (93%) rename src/backend/distributed/sql/{downgrades => }/citus--11.2-1--11.1-1.sql (82%) rename src/backend/distributed/sql/{downgrades => }/citus--9.2-4--9.2-2.sql (100%) rename src/backend/distributed/sql/{downgrades => }/citus--9.3-2--9.2-4.sql (100%) rename src/backend/distributed/sql/{downgrades => }/citus--9.4-1--9.3-2.sql (100%) rename src/backend/distributed/sql/{downgrades => }/citus--9.5-1--9.4-1.sql (98%) delete mode 100644 src/backend/distributed/sql/downgrades/citus--10.2-2--10.2-1.sql delete mode 100644 src/backend/distributed/sql/downgrades/citus--10.2-3--10.2-2.sql delete mode 100644 src/backend/distributed/sql/downgrades/citus--11.0-3--11.0-2.sql diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cff39bf513a..73ccb327282 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -43,8 +43,6 @@ that are missing in earlier minor versions. ./configure make make install - # Optionally, you might instead want to use `make install-all` - # since `multi_extension` regression test would fail due to missing downgrade scripts. cd src/test/regress pip install pipenv @@ -81,8 +79,6 @@ that are missing in earlier minor versions. ./configure make sudo make install - # Optionally, you might instead want to use `sudo make install-all` - # since `multi_extension` regression test would fail due to missing downgrade scripts. cd src/test/regress pip install pipenv @@ -131,8 +127,6 @@ that are missing in earlier minor versions. PG_CONFIG=/usr/pgsql-14/bin/pg_config ./configure make sudo make install - # Optionally, you might instead want to use `sudo make install-all` - # since `multi_extension` regression test would fail due to missing downgrade scripts. cd src/test/regress pip install pipenv diff --git a/Makefile b/Makefile index 12b26cbbe27..465c8bd7121 100644 --- a/Makefile +++ b/Makefile @@ -38,11 +38,7 @@ clean-full: $(MAKE) -C src/backend/distributed/ clean-full .PHONY: extension install-extension clean-extension clean-full -install-downgrades: - $(MAKE) -C src/backend/distributed/ install-downgrades -install-all: install-headers install-pg_send_cancellation - $(MAKE) -C src/backend/columnar/ install-all - $(MAKE) -C src/backend/distributed/ install-all +install-all: install # build citus_send_cancellation binary pg_send_cancellation: @@ -64,8 +60,7 @@ check-style: cd ${citus_abs_top_srcdir} && citus_indent --quiet --check .PHONY: reindent check-style -# depend on install-all so that downgrade scripts are installed as well -check: all install-all +check: all install $(MAKE) -C src/test/regress check-full -.PHONY: all check clean install install-downgrades install-all +.PHONY: all check clean install install-all diff --git a/ci/build-citus.sh b/ci/build-citus.sh index 49f92e69134..ca41e1ae69a 100755 --- a/ci/build-citus.sh +++ b/ci/build-citus.sh @@ -36,7 +36,7 @@ build_ext() { CFLAGS=-Werror "${basedir}/configure" PG_CONFIG="/usr/lib/postgresql/${pg_major}/bin/pg_config" --enable-coverage --with-security-flags installdir="${builddir}/install" - make -j$(nproc) && mkdir -p "${installdir}" && { make DESTDIR="${installdir}" install-all || make DESTDIR="${installdir}" install ; } + make -j$(nproc) && mkdir -p "${installdir}" && make DESTDIR="${installdir}" install cd "${installdir}" && find . -type f -print > "${builddir}/files.lst" tar cvf "${basedir}/install-${pg_major}.tar" `cat ${builddir}/files.lst` diff --git a/gucs_in_citus.out b/gucs_in_citus.out new file mode 100644 index 00000000000..daba8df1679 --- /dev/null +++ b/gucs_in_citus.out @@ -0,0 +1,121 @@ +citus.all_modifications_commutative +citus.allow_modifications_from_workers_to_replicated_tables +citus.allow_nested_distributed_execution +citus.allow_unsafe_constraints +citus.allow_unsafe_locks_from_workers +citus.background_task_queue_interval +citus.check_available_space_before_move +citus.cluster_name +citus.coordinator_aggregation_strategy +citus.copy_switchover_threshold +citus.count_distinct_error_rate +citus.cpu_priority +citus.cpu_priority_for_logical_replication_senders +citus.create_object_propagation +citus.defer_drop_after_shard_move +citus.defer_drop_after_shard_split +citus.defer_shard_delete_interval +citus.desired_percent_disk_available_after_move +citus.distributed_deadlock_detection_factor +citus.enable_alter_database_owner +citus.enable_alter_role_propagation +citus.enable_alter_role_set_propagation +citus.enable_binary_protocol +citus.enable_cluster_clock +citus.enable_cost_based_connection_establishment +citus.enable_create_role_propagation +citus.enable_create_type_propagation +citus.enable_ddl_propagation +citus.enable_deadlock_prevention +citus.enable_fast_path_router_planner +citus.enable_local_execution +citus.enable_local_reference_table_foreign_keys +citus.enable_manual_changes_to_shards +citus.enable_manual_metadata_changes_for_user +citus.enable_metadata_sync +citus.enable_repartition_joins +citus.enable_repartitioned_insert_select +citus.enable_router_execution +citus.enable_single_hash_repartition_joins +citus.enable_statistics_collection +citus.enable_unique_job_ids +citus.enable_unsafe_triggers +citus.enable_unsupported_feature_messages +citus.enable_version_checks +citus.enforce_foreign_key_restrictions +citus.enforce_object_restrictions_for_local_objects +citus.executor_slow_start_interval +citus.explain_all_tasks +citus.explain_analyze_sort_method +citus.explain_distributed_queries +citus.force_max_query_parallelization +citus.function_opens_transaction_block +citus.grep_remote_commands +citus.hide_citus_dependent_objects +citus.hide_shards_from_app_name_prefixes +citus.isolation_test_session_process_id +citus.isolation_test_session_remote_process_id +citus.limit_clause_row_fetch_count +citus.local_copy_flush_threshold +citus.local_hostname +citus.local_shared_pool_size +citus.local_table_join_policy +citus.log_distributed_deadlock_detection +citus.log_intermediate_results +citus.log_local_commands +citus.log_multi_join_order +citus.log_remote_commands +citus.logical_replication_timeout +citus.max_adaptive_executor_pool_size +citus.max_background_task_executors +citus.max_cached_connection_lifetime +citus.max_cached_conns_per_worker +citus.max_client_connections +citus.max_high_priority_background_processes +citus.max_intermediate_result_size +citus.max_matview_size_to_auto_recreate +citus.max_rebalancer_logged_ignored_moves +citus.max_shared_pool_size +citus.max_worker_nodes_tracked +citus.metadata_sync_interval +citus.metadata_sync_retry_interval +citus.mitmfifo +citus.multi_shard_modify_mode +citus.multi_task_query_log_level +citus.next_cleanup_record_id +citus.next_operation_id +citus.next_placement_id +citus.next_shard_id +citus.node_connection_timeout +citus.node_conninfo +citus.override_table_visibility +citus.prevent_incomplete_connection_establishment +citus.propagate_session_settings_for_loopback_connection +citus.propagate_set_commands +citus.recover_2pc_interval +citus.remote_copy_flush_threshold +citus.remote_task_check_interval +citus.repartition_join_bucket_count_per_node +citus.replicate_reference_tables_on_activate +citus.replication_model +citus.running_under_isolation_test +citus.select_opens_transaction_block +citus.shard_count +citus.shard_replication_factor +citus.show_shards_for_app_name_prefixes +citus.skip_advisory_lock_permission_checks +citus.skip_constraint_validation +citus.skip_jsonb_validation_in_copy +citus.sort_returning +citus.stat_statements_max +citus.stat_statements_purge_interval +citus.stat_statements_track +citus.subquery_pushdown +citus.task_assignment_policy +citus.task_executor_type +citus.use_citus_managed_tables +citus.use_secondary_nodes +citus.values_materialization_threshold +citus.version +citus.worker_min_messages +citus.writable_standby_coordinator diff --git a/src/backend/columnar/Makefile b/src/backend/columnar/Makefile index f9fa09b7c09..5d217547daa 100644 --- a/src/backend/columnar/Makefile +++ b/src/backend/columnar/Makefile @@ -11,9 +11,7 @@ MODULE_big = citus_columnar EXTENSION = citus_columnar columnar_sql_files = $(patsubst $(citus_abs_srcdir)/%,%,$(wildcard $(citus_abs_srcdir)/sql/*.sql)) -columnar_downgrade_sql_files = $(patsubst $(citus_abs_srcdir)/%,%,$(wildcard $(citus_abs_srcdir)/sql/downgrades/*.sql)) -DATA = $(columnar_sql_files) \ - $(columnar_downgrade_sql_files) +DATA = $(columnar_sql_files) PG_CPPFLAGS += -I$(libpq_srcdir) -I$(safestringlib_srcdir)/include diff --git a/src/backend/columnar/sql/downgrades/citus--11.0-3--11.0-2.sql b/src/backend/columnar/sql/citus--11.0-3--11.0-2.sql similarity index 100% rename from src/backend/columnar/sql/downgrades/citus--11.0-3--11.0-2.sql rename to src/backend/columnar/sql/citus--11.0-3--11.0-2.sql diff --git a/src/backend/columnar/sql/downgrades/citus_columnar--11.1-1--11.1-0.sql b/src/backend/columnar/sql/citus_columnar--11.1-1--11.1-0.sql similarity index 100% rename from src/backend/columnar/sql/downgrades/citus_columnar--11.1-1--11.1-0.sql rename to src/backend/columnar/sql/citus_columnar--11.1-1--11.1-0.sql diff --git a/src/backend/columnar/sql/downgrades/citus_columnar--11.2-1--11.1-1.sql b/src/backend/columnar/sql/citus_columnar--11.2-1--11.1-1.sql similarity index 100% rename from src/backend/columnar/sql/downgrades/citus_columnar--11.2-1--11.1-1.sql rename to src/backend/columnar/sql/citus_columnar--11.2-1--11.1-1.sql diff --git a/src/backend/columnar/sql/downgrades/columnar--10.0-1--9.5-1.sql b/src/backend/columnar/sql/columnar--10.0-1--9.5-1.sql similarity index 100% rename from src/backend/columnar/sql/downgrades/columnar--10.0-1--9.5-1.sql rename to src/backend/columnar/sql/columnar--10.0-1--9.5-1.sql diff --git a/src/backend/columnar/sql/downgrades/columnar--10.0-2--10.0-1.sql b/src/backend/columnar/sql/columnar--10.0-2--10.0-1.sql similarity index 100% rename from src/backend/columnar/sql/downgrades/columnar--10.0-2--10.0-1.sql rename to src/backend/columnar/sql/columnar--10.0-2--10.0-1.sql diff --git a/src/backend/columnar/sql/downgrades/columnar--10.1-1--10.0-3.sql b/src/backend/columnar/sql/columnar--10.1-1--10.0-3.sql similarity index 88% rename from src/backend/columnar/sql/downgrades/columnar--10.1-1--10.0-3.sql rename to src/backend/columnar/sql/columnar--10.1-1--10.0-3.sql index 0da503163e9..4b5eaaca9ba 100644 --- a/src/backend/columnar/sql/downgrades/columnar--10.1-1--10.0-3.sql +++ b/src/backend/columnar/sql/columnar--10.1-1--10.0-3.sql @@ -10,4 +10,4 @@ ADD FOREIGN KEY (storage_id, stripe_num) REFERENCES columnar.stripe(storage_id, stripe_num) ON DELETE CASCADE; -- define columnar_ensure_objects_exist again -#include "../udfs/columnar_ensure_objects_exist/10.0-1.sql" +#include "udfs/columnar_ensure_objects_exist/10.0-1.sql" diff --git a/src/backend/columnar/sql/downgrades/columnar--10.2-1--10.1-1.sql b/src/backend/columnar/sql/columnar--10.2-1--10.1-1.sql similarity index 100% rename from src/backend/columnar/sql/downgrades/columnar--10.2-1--10.1-1.sql rename to src/backend/columnar/sql/columnar--10.2-1--10.1-1.sql diff --git a/src/backend/columnar/sql/downgrades/columnar--10.2-2--10.2-1.sql b/src/backend/columnar/sql/columnar--10.2-2--10.2-1.sql similarity index 100% rename from src/backend/columnar/sql/downgrades/columnar--10.2-2--10.2-1.sql rename to src/backend/columnar/sql/columnar--10.2-2--10.2-1.sql diff --git a/src/backend/columnar/sql/downgrades/columnar--10.2-3--10.2-2.sql b/src/backend/columnar/sql/columnar--10.2-3--10.2-2.sql similarity index 100% rename from src/backend/columnar/sql/downgrades/columnar--10.2-3--10.2-2.sql rename to src/backend/columnar/sql/columnar--10.2-3--10.2-2.sql diff --git a/src/backend/columnar/sql/downgrades/columnar--10.2-4--10.2-3.sql b/src/backend/columnar/sql/columnar--10.2-4--10.2-3.sql similarity index 100% rename from src/backend/columnar/sql/downgrades/columnar--10.2-4--10.2-3.sql rename to src/backend/columnar/sql/columnar--10.2-4--10.2-3.sql diff --git a/src/backend/columnar/sql/downgrades/columnar--11.1-1--11.0-3.sql b/src/backend/columnar/sql/columnar--11.1-1--11.0-3.sql similarity index 71% rename from src/backend/columnar/sql/downgrades/columnar--11.1-1--11.0-3.sql rename to src/backend/columnar/sql/columnar--11.1-1--11.0-3.sql index ae763e62d25..6b775386723 100644 --- a/src/backend/columnar/sql/downgrades/columnar--11.1-1--11.0-3.sql +++ b/src/backend/columnar/sql/columnar--11.1-1--11.0-3.sql @@ -1,7 +1,7 @@ -#include "../udfs/alter_columnar_table_set/10.0-1.sql" -#include "../udfs/alter_columnar_table_reset/10.0-1.sql" +#include "udfs/alter_columnar_table_set/10.0-1.sql" +#include "udfs/alter_columnar_table_reset/10.0-1.sql" -#include "../udfs/columnar_ensure_am_depends_catalog/10.2-4.sql" +#include "udfs/columnar_ensure_am_depends_catalog/10.2-4.sql" DROP VIEW columnar.options; DROP VIEW columnar.stripe; diff --git a/src/backend/distributed/Makefile b/src/backend/distributed/Makefile index a51c2a1f544..f572622817a 100644 --- a/src/backend/distributed/Makefile +++ b/src/backend/distributed/Makefile @@ -11,9 +11,7 @@ MODULE_big = citus EXTENSION = citus template_sql_files = $(patsubst $(citus_abs_srcdir)/%,%,$(wildcard $(citus_abs_srcdir)/sql/*.sql)) -template_downgrade_sql_files = $(patsubst $(citus_abs_srcdir)/sql/downgrades/%,%,$(wildcard $(citus_abs_srcdir)/sql/downgrades/*.sql)) generated_sql_files = $(patsubst %,$(citus_abs_srcdir)/build/%,$(template_sql_files)) -generated_downgrade_sql_files += $(patsubst %,$(citus_abs_srcdir)/build/sql/%,$(template_downgrade_sql_files)) # All citus--*.sql files that are used to upgrade between versions DATA_built = $(generated_sql_files) @@ -65,34 +63,19 @@ $(generated_sql_files): $(citus_abs_srcdir)/build/%: % @# `man cpp` for further information cd $(citus_abs_srcdir) && cpp -undef -w -P -MMD -MP -MF$(SQL_DEPDIR)/$(*F).Po -MT$@ $< > $@ -$(generated_downgrade_sql_files): $(citus_abs_srcdir)/build/sql/%: sql/downgrades/% - @mkdir -p $(citus_abs_srcdir)/$(SQL_DEPDIR) $(citus_abs_srcdir)/$(SQL_BUILDDIR) - @# -MF is used to store dependency files(.Po) in another directory for separation - @# -MT is used to change the target of the rule emitted by dependency generation. - @# -P is used to inhibit generation of linemarkers in the output from the preprocessor. - @# -undef is used to not predefine any system-specific or GCC-specific macros. - @# `man cpp` for further information - cd $(citus_abs_srcdir) && cpp -undef -w -P -MMD -MP -MF$(SQL_DEPDIR)/$(*F).Po -MT$@ $< > $@ - SQL_Po_files := $(wildcard $(SQL_DEPDIR)/*.Po) ifneq (,$(SQL_Po_files)) include $(SQL_Po_files) endif -.PHONY: clean-full install install-downgrades install-all +.PHONY: clean-full install install-all cleanup-before-install: rm -f $(DESTDIR)$(datadir)/$(datamoduledir)/citus.control rm -f $(DESTDIR)$(datadir)/$(datamoduledir)/citus--* install: cleanup-before-install - -# install and install-downgrades should be run sequentially install-all: install - $(MAKE) install-downgrades - -install-downgrades: $(generated_downgrade_sql_files) - $(INSTALL_DATA) $(generated_downgrade_sql_files) '$(DESTDIR)$(datadir)/$(datamoduledir)/' clean-full: $(MAKE) clean diff --git a/src/backend/distributed/sql/downgrades/citus--10.0-4--9.5-1.sql b/src/backend/distributed/sql/citus--10.0-4--9.5-1.sql similarity index 93% rename from src/backend/distributed/sql/downgrades/citus--10.0-4--9.5-1.sql rename to src/backend/distributed/sql/citus--10.0-4--9.5-1.sql index a7278a21a3e..93a4aee6f23 100644 --- a/src/backend/distributed/sql/downgrades/citus--10.0-4--9.5-1.sql +++ b/src/backend/distributed/sql/citus--10.0-4--9.5-1.sql @@ -21,7 +21,7 @@ DROP FUNCTION pg_catalog.citus_update_table_statistics(regclass); -#include "../udfs/citus_update_table_statistics/10.0-1.sql" +#include "udfs/citus_update_table_statistics/10.0-1.sql" CREATE OR REPLACE FUNCTION master_update_table_statistics(relation regclass) RETURNS VOID AS $$ @@ -43,7 +43,7 @@ COMMENT ON FUNCTION master_update_table_statistics(regclass) DROP FUNCTION pg_catalog.citus_get_active_worker_nodes(OUT text, OUT bigint); -- copy of citus--10.0-2--10.0-1.sql -#include "../../../columnar/sql/downgrades/columnar--10.0-2--10.0-1.sql" +#include "../../columnar/sql/columnar--10.0-2--10.0-1.sql" -- copy of citus--10.0-1--9.5-1 @@ -56,14 +56,14 @@ DROP FUNCTION pg_catalog.citus_get_active_worker_nodes(OUT text, OUT bigint); -- citus_drop_all_shards as we renamed it in Citus 10.0. ALTER FUNCTION pg_catalog.citus_drop_all_shards(regclass, text, text) RENAME TO master_drop_all_shards; -#include "../udfs/citus_drop_trigger/9.5-1.sql" +#include "udfs/citus_drop_trigger/9.5-1.sql" -- Now we can safely drop notify_constraint_dropped as we downgraded citus_drop_trigger. DROP FUNCTION pg_catalog.notify_constraint_dropped(); -#include "../udfs/citus_finish_pg_upgrade/9.5-1.sql" +#include "udfs/citus_finish_pg_upgrade/9.5-1.sql" -#include "../../../columnar/sql/downgrades/columnar--10.0-1--9.5-1.sql" +#include "../../columnar/sql/columnar--10.0-1--9.5-1.sql" DROP VIEW IF EXISTS pg_catalog.citus_tables; DROP VIEW IF EXISTS public.citus_tables; @@ -102,13 +102,13 @@ RENAME TO master_dist_placement_cache_invalidate; ALTER FUNCTION pg_catalog.citus_dist_shard_cache_invalidate() RENAME TO master_dist_shard_cache_invalidate; -#include "../udfs/citus_conninfo_cache_invalidate/9.5-1.sql" -#include "../udfs/citus_dist_local_group_cache_invalidate/9.5-1.sql" -#include "../udfs/citus_dist_node_cache_invalidate/9.5-1.sql" -#include "../udfs/citus_dist_object_cache_invalidate/9.5-1.sql" -#include "../udfs/citus_dist_partition_cache_invalidate/9.5-1.sql" -#include "../udfs/citus_dist_placement_cache_invalidate/9.5-1.sql" -#include "../udfs/citus_dist_shard_cache_invalidate/9.5-1.sql" +#include "udfs/citus_conninfo_cache_invalidate/9.5-1.sql" +#include "udfs/citus_dist_local_group_cache_invalidate/9.5-1.sql" +#include "udfs/citus_dist_node_cache_invalidate/9.5-1.sql" +#include "udfs/citus_dist_object_cache_invalidate/9.5-1.sql" +#include "udfs/citus_dist_partition_cache_invalidate/9.5-1.sql" +#include "udfs/citus_dist_placement_cache_invalidate/9.5-1.sql" +#include "udfs/citus_dist_shard_cache_invalidate/9.5-1.sql" DROP VIEW pg_catalog.time_partitions; DROP FUNCTION pg_catalog.time_partition_range(regclass); @@ -150,10 +150,10 @@ CREATE FUNCTION pg_catalog.master_create_worker_shards(table_name text, shard_co DROP FUNCTION pg_catalog.remove_local_tables_from_metadata(); -#include "../udfs/citus_total_relation_size/7.0-1.sql" -#include "../udfs/upgrade_to_reference_table/8.0-1.sql" -#include "../udfs/undistribute_table/9.5-1.sql" -#include "../udfs/create_citus_local_table/9.5-1.sql" +#include "udfs/citus_total_relation_size/7.0-1.sql" +#include "udfs/upgrade_to_reference_table/8.0-1.sql" +#include "udfs/undistribute_table/9.5-1.sql" +#include "udfs/create_citus_local_table/9.5-1.sql" DROP VIEW pg_catalog.citus_shards CASCADE; DROP FUNCTION pg_catalog.citus_shard_sizes(OUT table_name text, OUT size bigint); diff --git a/src/backend/distributed/sql/downgrades/citus--10.1-1--10.0-4.sql b/src/backend/distributed/sql/citus--10.1-1--10.0-4.sql similarity index 88% rename from src/backend/distributed/sql/downgrades/citus--10.1-1--10.0-4.sql rename to src/backend/distributed/sql/citus--10.1-1--10.0-4.sql index 10fb1059328..afae3d82956 100644 --- a/src/backend/distributed/sql/downgrades/citus--10.1-1--10.0-4.sql +++ b/src/backend/distributed/sql/citus--10.1-1--10.0-4.sql @@ -9,7 +9,7 @@ DELETE FROM citus.pg_dist_object WHERE classid = 'pg_catalog.pg_database'::regclass::oid; -#include "../../../columnar/sql/downgrades/columnar--10.1-1--10.0-3.sql" +#include "../../columnar/sql/columnar--10.1-1--10.0-3.sql" DROP FUNCTION pg_catalog.create_distributed_table(regclass, text, citus.distribution_type, text, int); CREATE FUNCTION create_distributed_table(table_name regclass, @@ -30,21 +30,21 @@ DROP FUNCTION pg_catalog.worker_partitioned_relation_size(regclass); DROP FUNCTION pg_catalog.worker_partitioned_table_size(regclass); DROP FUNCTION pg_catalog.citus_local_disk_space_stats(); -#include "../udfs/citus_prepare_pg_upgrade/9.5-1.sql" -#include "../udfs/citus_finish_pg_upgrade/10.0-1.sql" -#include "../udfs/get_rebalance_table_shards_plan/9.2-1.sql" +#include "udfs/citus_prepare_pg_upgrade/9.5-1.sql" +#include "udfs/citus_finish_pg_upgrade/10.0-1.sql" +#include "udfs/get_rebalance_table_shards_plan/9.2-1.sql" -- the migration for citus_add_rebalance_strategy from 9.2-1 was the first one, -- so it doesn't have a DROP. This is why we DROP manually here. DROP FUNCTION pg_catalog.citus_add_rebalance_strategy; -#include "../udfs/citus_add_rebalance_strategy/9.2-1.sql" +#include "udfs/citus_add_rebalance_strategy/9.2-1.sql" ALTER TABLE pg_catalog.pg_dist_rebalance_strategy DROP COLUMN improvement_threshold; -- the migration for get_rebalance_progress from 9.0-1 was the first one, -- so it doesn't have a DROP. This is why we DROP manually here. DROP FUNCTION pg_catalog.get_rebalance_progress; -#include "../udfs/get_rebalance_progress/9.0-1.sql" +#include "udfs/get_rebalance_progress/9.0-1.sql" CREATE OR REPLACE VIEW pg_catalog.citus_shards AS WITH shard_sizes AS (SELECT * FROM pg_catalog.citus_shard_sizes()) @@ -79,7 +79,7 @@ ORDER BY pg_dist_shard.logicalrelid::text, shardid ; -#include "../udfs/citus_finish_pg_upgrade/10.0-1.sql" +#include "udfs/citus_finish_pg_upgrade/10.0-1.sql" CREATE FUNCTION citus_internal.pg_dist_rebalance_strategy_enterprise_check() RETURNS TRIGGER LANGUAGE C diff --git a/src/backend/distributed/sql/downgrades/citus--10.2-1--10.1-1.sql b/src/backend/distributed/sql/citus--10.2-1--10.1-1.sql similarity index 94% rename from src/backend/distributed/sql/downgrades/citus--10.2-1--10.1-1.sql rename to src/backend/distributed/sql/citus--10.2-1--10.1-1.sql index 1e47b42c4c8..07465297838 100644 --- a/src/backend/distributed/sql/downgrades/citus--10.2-1--10.1-1.sql +++ b/src/backend/distributed/sql/citus--10.2-1--10.1-1.sql @@ -1,6 +1,6 @@ -- citus--10.2-1--10.1-1 -#include "../../../columnar/sql/downgrades/columnar--10.2-1--10.1-1.sql" +#include "../../columnar/sql/columnar--10.2-1--10.1-1.sql" DROP FUNCTION pg_catalog.stop_metadata_sync_to_node(text, integer, bool); @@ -35,4 +35,4 @@ CREATE FUNCTION pg_catalog.citus_drop_all_shards(logicalrelid regclass, AS 'MODULE_PATHNAME', $$master_drop_all_shards$$; COMMENT ON FUNCTION pg_catalog.citus_drop_all_shards(regclass, text, text) IS 'drop all shards in a relation and update metadata'; -#include "../udfs/citus_drop_trigger/10.0-1.sql" +#include "udfs/citus_drop_trigger/10.0-1.sql" diff --git a/src/backend/distributed/sql/citus--10.2-2--10.2-1.sql b/src/backend/distributed/sql/citus--10.2-2--10.2-1.sql new file mode 100644 index 00000000000..adef95f957d --- /dev/null +++ b/src/backend/distributed/sql/citus--10.2-2--10.2-1.sql @@ -0,0 +1,3 @@ +-- citus--10.2-2--10.2-1 + +#include "../../columnar/sql/columnar--10.2-2--10.2-1.sql" diff --git a/src/backend/distributed/sql/citus--10.2-3--10.2-2.sql b/src/backend/distributed/sql/citus--10.2-3--10.2-2.sql new file mode 100644 index 00000000000..bf82d79f08e --- /dev/null +++ b/src/backend/distributed/sql/citus--10.2-3--10.2-2.sql @@ -0,0 +1,3 @@ +-- citus--10.2-3--10.2-2 + +#include "../../columnar/sql/columnar--10.2-3--10.2-2.sql" diff --git a/src/backend/distributed/sql/downgrades/citus--10.2-4--10.2-3.sql b/src/backend/distributed/sql/citus--10.2-4--10.2-3.sql similarity index 78% rename from src/backend/distributed/sql/downgrades/citus--10.2-4--10.2-3.sql rename to src/backend/distributed/sql/citus--10.2-4--10.2-3.sql index b4dd8f4014a..2ef3527a2a3 100644 --- a/src/backend/distributed/sql/downgrades/citus--10.2-4--10.2-3.sql +++ b/src/backend/distributed/sql/citus--10.2-4--10.2-3.sql @@ -4,9 +4,9 @@ DROP FUNCTION pg_catalog.fix_all_partition_shard_index_names(); DROP FUNCTION pg_catalog.fix_partition_shard_index_names(regclass); DROP FUNCTION pg_catalog.worker_fix_partition_shard_index_names(regclass, text, text); -#include "../udfs/citus_finish_pg_upgrade/10.2-1.sql" +#include "udfs/citus_finish_pg_upgrade/10.2-1.sql" -- This needs to be done after downgrading citus_finish_pg_upgrade. This is -- because citus_finish_pg_upgrade/10.2-4 depends on columnar_ensure_am_depends_catalog, -- which is dropped by columnar--10.2-4--10.2-3.sql -#include "../../../columnar/sql/downgrades/columnar--10.2-4--10.2-3.sql" +#include "../../columnar/sql/columnar--10.2-4--10.2-3.sql" diff --git a/src/backend/distributed/sql/downgrades/citus--11.0-1--10.2-4.sql b/src/backend/distributed/sql/citus--11.0-1--10.2-4.sql similarity index 99% rename from src/backend/distributed/sql/downgrades/citus--11.0-1--10.2-4.sql rename to src/backend/distributed/sql/citus--11.0-1--10.2-4.sql index b7f4018d920..1f9a6d9bf7d 100644 --- a/src/backend/distributed/sql/downgrades/citus--11.0-1--10.2-4.sql +++ b/src/backend/distributed/sql/citus--11.0-1--10.2-4.sql @@ -5,7 +5,7 @@ ALTER TABLE pg_catalog.pg_dist_object SET SCHEMA citus; DROP FUNCTION pg_catalog.create_distributed_function(regprocedure, text, text, bool); DROP FUNCTION pg_catalog.worker_partition_query_result(text, text, int, citus.distribution_type, text[], text[], boolean, boolean, boolean); -#include "../udfs/worker_partition_query_result/9.2-1.sql" +#include "udfs/worker_partition_query_result/9.2-1.sql" CREATE FUNCTION pg_catalog.master_apply_delete_command(text) RETURNS integer @@ -91,7 +91,7 @@ ORDER BY 1,2; DROP FUNCTION pg_catalog.citus_shards_on_worker(); DROP FUNCTION pg_catalog.citus_shard_indexes_on_worker(); -#include "../udfs/create_distributed_function/9.0-1.sql" +#include "udfs/create_distributed_function/9.0-1.sql" ALTER TABLE citus.pg_dist_object DROP COLUMN force_delegation; SET search_path = 'pg_catalog'; @@ -175,7 +175,7 @@ COMMENT ON FUNCTION citus_worker_stat_activity(OUT query_hostname text, OUT quer IS 'returns distributed transaction activity on shards of distributed tables'; DROP FUNCTION pg_catalog.worker_create_or_replace_object(text[]); -#include "../udfs/worker_create_or_replace_object/9.0-1.sql" +#include "udfs/worker_create_or_replace_object/9.0-1.sql" DROP FUNCTION IF EXISTS pg_catalog.pg_cancel_backend(bigint); DROP FUNCTION IF EXISTS pg_catalog.pg_terminate_backend(bigint, bigint); diff --git a/src/backend/distributed/sql/downgrades/citus--11.0-2--11.0-1.sql b/src/backend/distributed/sql/citus--11.0-2--11.0-1.sql similarity index 80% rename from src/backend/distributed/sql/downgrades/citus--11.0-2--11.0-1.sql rename to src/backend/distributed/sql/citus--11.0-2--11.0-1.sql index 3cbbcc883e8..8504b8c0ed4 100644 --- a/src/backend/distributed/sql/downgrades/citus--11.0-2--11.0-1.sql +++ b/src/backend/distributed/sql/citus--11.0-2--11.0-1.sql @@ -1,6 +1,6 @@ -#include "../udfs/citus_shards_on_worker/11.0-1.sql" -#include "../udfs/citus_shard_indexes_on_worker/11.0-1.sql" -#include "../udfs/citus_finalize_upgrade_to_citus11/11.0-1.sql" +#include "udfs/citus_shards_on_worker/11.0-1.sql" +#include "udfs/citus_shard_indexes_on_worker/11.0-1.sql" +#include "udfs/citus_finalize_upgrade_to_citus11/11.0-1.sql" DROP FUNCTION pg_catalog.citus_disable_node(text, integer, bool); CREATE FUNCTION pg_catalog.citus_disable_node(nodename text, nodeport integer, force bool default false) diff --git a/src/backend/distributed/sql/citus--11.0-3--11.0-2.sql b/src/backend/distributed/sql/citus--11.0-3--11.0-2.sql new file mode 100644 index 00000000000..382c8fb0de1 --- /dev/null +++ b/src/backend/distributed/sql/citus--11.0-3--11.0-2.sql @@ -0,0 +1 @@ +#include "udfs/citus_finalize_upgrade_to_citus11/11.0-2.sql" diff --git a/src/backend/distributed/sql/downgrades/citus--11.1-1--11.0-4.sql b/src/backend/distributed/sql/citus--11.1-1--11.0-4.sql similarity index 93% rename from src/backend/distributed/sql/downgrades/citus--11.1-1--11.0-4.sql rename to src/backend/distributed/sql/citus--11.1-1--11.0-4.sql index 54317790c50..af979e25d3f 100644 --- a/src/backend/distributed/sql/downgrades/citus--11.1-1--11.0-4.sql +++ b/src/backend/distributed/sql/citus--11.1-1--11.0-4.sql @@ -88,19 +88,19 @@ DROP FUNCTION pg_catalog.worker_split_shard_release_dsm(); DROP FUNCTION pg_catalog.get_all_active_transactions(OUT datid oid, OUT process_id int, OUT initiator_node_identifier int4, OUT worker_query BOOL, OUT transaction_number int8, OUT transaction_stamp timestamptz, OUT global_pid int8); -#include "../udfs/get_all_active_transactions/11.0-1.sql" +#include "udfs/get_all_active_transactions/11.0-1.sql" DROP VIEW pg_catalog.citus_locks; DROP FUNCTION pg_catalog.citus_locks(); -#include "../udfs/citus_tables/10.0-4.sql" -#include "../udfs/citus_shards/10.1-1.sql" +#include "udfs/citus_tables/10.0-4.sql" +#include "udfs/citus_shards/10.1-1.sql" DROP FUNCTION pg_catalog.replicate_reference_tables(citus.shard_transfer_mode); -#include "../udfs/replicate_reference_tables/9.3-2.sql" +#include "udfs/replicate_reference_tables/9.3-2.sql" DROP FUNCTION pg_catalog.isolate_tenant_to_new_shard(table_name regclass, tenant_id "any", cascade_option text, shard_transfer_mode citus.shard_transfer_mode); -#include "../udfs/isolate_tenant_to_new_shard/8.0-1.sql" +#include "udfs/isolate_tenant_to_new_shard/8.0-1.sql" DROP FUNCTION pg_catalog.create_distributed_table_concurrently; DROP FUNCTION pg_catalog.citus_internal_delete_partition_metadata(regclass); @@ -141,5 +141,5 @@ DROP TYPE pg_catalog.citus_task_status; DROP TABLE pg_catalog.pg_dist_background_job; DROP TYPE pg_catalog.citus_job_status; DROP FUNCTION pg_catalog.citus_copy_shard_placement; -#include "../udfs/citus_copy_shard_placement/10.0-1.sql" -#include "../udfs/get_rebalance_progress/10.1-1.sql" +#include "udfs/citus_copy_shard_placement/10.0-1.sql" +#include "udfs/get_rebalance_progress/10.1-1.sql" diff --git a/src/backend/distributed/sql/downgrades/citus--11.2-1--11.1-1.sql b/src/backend/distributed/sql/citus--11.2-1--11.1-1.sql similarity index 82% rename from src/backend/distributed/sql/downgrades/citus--11.2-1--11.1-1.sql rename to src/backend/distributed/sql/citus--11.2-1--11.1-1.sql index 736f751c1e0..ab0150a862a 100644 --- a/src/backend/distributed/sql/downgrades/citus--11.2-1--11.1-1.sql +++ b/src/backend/distributed/sql/citus--11.2-1--11.1-1.sql @@ -1,6 +1,6 @@ -- citus--11.2-1--11.1-1 -#include "../udfs/get_rebalance_progress/11.1-1.sql" -#include "../udfs/citus_isolation_test_session_is_blocked/11.1-1.sql" +#include "udfs/get_rebalance_progress/11.1-1.sql" +#include "udfs/citus_isolation_test_session_is_blocked/11.1-1.sql" DROP FUNCTION pg_catalog.citus_get_node_clock(); DROP FUNCTION pg_catalog.citus_get_transaction_clock(); DROP FUNCTION pg_catalog.citus_internal_adjust_local_clock_to_remote(cluster_clock); @@ -24,12 +24,12 @@ CREATE FUNCTION pg_catalog.worker_append_table_to_shard(text, text, text, intege COMMENT ON FUNCTION pg_catalog.worker_append_table_to_shard(text, text, text, integer) IS 'append a regular table''s contents to the shard'; -#include "../udfs/worker_split_shard_replication_setup/11.1-1.sql" +#include "udfs/worker_split_shard_replication_setup/11.1-1.sql" DROP FUNCTION pg_catalog.citus_task_wait(bigint, pg_catalog.citus_task_status); -#include "../udfs/citus_prepare_pg_upgrade/11.1-1.sql" -#include "../udfs/citus_finish_pg_upgrade/11.1-1.sql" +#include "udfs/citus_prepare_pg_upgrade/11.1-1.sql" +#include "udfs/citus_finish_pg_upgrade/11.1-1.sql" DROP FUNCTION pg_catalog.citus_copy_shard_placement(bigint, integer, integer, citus.shard_transfer_mode); DROP FUNCTION pg_catalog.citus_move_shard_placement(bigint, integer, integer, citus.shard_transfer_mode); DROP FUNCTION pg_catalog.citus_internal_add_placement_metadata(bigint, bigint, integer, bigint); -#include "../udfs/citus_internal_add_placement_metadata/10.2-1.sql" +#include "udfs/citus_internal_add_placement_metadata/10.2-1.sql" diff --git a/src/backend/distributed/sql/downgrades/citus--9.2-4--9.2-2.sql b/src/backend/distributed/sql/citus--9.2-4--9.2-2.sql similarity index 100% rename from src/backend/distributed/sql/downgrades/citus--9.2-4--9.2-2.sql rename to src/backend/distributed/sql/citus--9.2-4--9.2-2.sql diff --git a/src/backend/distributed/sql/downgrades/citus--9.3-2--9.2-4.sql b/src/backend/distributed/sql/citus--9.3-2--9.2-4.sql similarity index 100% rename from src/backend/distributed/sql/downgrades/citus--9.3-2--9.2-4.sql rename to src/backend/distributed/sql/citus--9.3-2--9.2-4.sql diff --git a/src/backend/distributed/sql/downgrades/citus--9.4-1--9.3-2.sql b/src/backend/distributed/sql/citus--9.4-1--9.3-2.sql similarity index 100% rename from src/backend/distributed/sql/downgrades/citus--9.4-1--9.3-2.sql rename to src/backend/distributed/sql/citus--9.4-1--9.3-2.sql diff --git a/src/backend/distributed/sql/downgrades/citus--9.5-1--9.4-1.sql b/src/backend/distributed/sql/citus--9.5-1--9.4-1.sql similarity index 98% rename from src/backend/distributed/sql/downgrades/citus--9.5-1--9.4-1.sql rename to src/backend/distributed/sql/citus--9.5-1--9.4-1.sql index bb3d45be9fe..f2430bd1bcd 100644 --- a/src/backend/distributed/sql/downgrades/citus--9.5-1--9.4-1.sql +++ b/src/backend/distributed/sql/citus--9.5-1--9.4-1.sql @@ -2,7 +2,7 @@ SET search_path = 'pg_catalog'; -#include "../udfs/citus_drop_trigger/9.0-1.sql" +#include "udfs/citus_drop_trigger/9.0-1.sql" -- Check if user has any citus local tables. -- If not, DROP create_citus_local_table UDF and continue safely. diff --git a/src/backend/distributed/sql/downgrades/citus--10.2-2--10.2-1.sql b/src/backend/distributed/sql/downgrades/citus--10.2-2--10.2-1.sql deleted file mode 100644 index bd03e0af87f..00000000000 --- a/src/backend/distributed/sql/downgrades/citus--10.2-2--10.2-1.sql +++ /dev/null @@ -1,3 +0,0 @@ --- citus--10.2-2--10.2-1 - -#include "../../../columnar/sql/downgrades/columnar--10.2-2--10.2-1.sql" diff --git a/src/backend/distributed/sql/downgrades/citus--10.2-3--10.2-2.sql b/src/backend/distributed/sql/downgrades/citus--10.2-3--10.2-2.sql deleted file mode 100644 index b0ba0916010..00000000000 --- a/src/backend/distributed/sql/downgrades/citus--10.2-3--10.2-2.sql +++ /dev/null @@ -1,3 +0,0 @@ --- citus--10.2-3--10.2-2 - -#include "../../../columnar/sql/downgrades/columnar--10.2-3--10.2-2.sql" diff --git a/src/backend/distributed/sql/downgrades/citus--11.0-3--11.0-2.sql b/src/backend/distributed/sql/downgrades/citus--11.0-3--11.0-2.sql deleted file mode 100644 index d27417a608a..00000000000 --- a/src/backend/distributed/sql/downgrades/citus--11.0-3--11.0-2.sql +++ /dev/null @@ -1 +0,0 @@ -#include "../udfs/citus_finalize_upgrade_to_citus11/11.0-2.sql"