-
Notifications
You must be signed in to change notification settings - Fork 666
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix citus_shard_sizes bug with many shards
- Loading branch information
1 parent
c18586c
commit a90a3a7
Showing
13 changed files
with
197 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# Citus extension | ||
comment = 'Citus distributed database' | ||
default_version = '11.3-1' | ||
default_version = '11.3-2' | ||
module_pathname = '$libdir/citus' | ||
relocatable = false | ||
schema = pg_catalog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
DROP VIEW citus_shards; | ||
DROP VIEW IF EXISTS pg_catalog.citus_tables; | ||
DROP VIEW IF EXISTS public.citus_tables; | ||
DROP FUNCTION citus_shard_sizes; | ||
|
||
#include "udfs/citus_shard_sizes/11.3-2.sql" | ||
|
||
#include "udfs/citus_shards/11.3-2.sql" | ||
#include "udfs/citus_tables/11.3-2.sql" |
13 changes: 13 additions & 0 deletions
13
src/backend/distributed/sql/downgrades/citus--11.3-2--11.3-1.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
DROP VIEW IF EXISTS public.citus_tables; | ||
DROP VIEW IF EXISTS pg_catalog.citus_tables; | ||
|
||
DROP VIEW pg_catalog.citus_shards; | ||
DROP FUNCTION pg_catalog.citus_shard_sizes; | ||
#include "../udfs/citus_shard_sizes/10.0-1.sql" | ||
-- citus_shards/11.1-1.sql tries to create citus_shards in pg_catalog but it is not allowed. | ||
-- Here we use citus_shards/10.0-1.sql to properly create the view in citus schema and | ||
-- then alter it to pg_catalog, so citus_shards/11.1-1.sql can REPLACE it without any errors. | ||
#include "../udfs/citus_shards/10.0-1.sql" | ||
|
||
#include "../udfs/citus_tables/11.1-1.sql" | ||
#include "../udfs/citus_shards/11.1-1.sql" |
6 changes: 6 additions & 0 deletions
6
src/backend/distributed/sql/udfs/citus_shard_sizes/11.3-2.sql
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
4 changes: 2 additions & 2 deletions
4
src/backend/distributed/sql/udfs/citus_shard_sizes/latest.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
CREATE FUNCTION pg_catalog.citus_shard_sizes(OUT table_name text, OUT size bigint) | ||
CREATE OR REPLACE FUNCTION pg_catalog.citus_shard_sizes(OUT shard_id int, OUT size bigint) | ||
RETURNS SETOF RECORD | ||
LANGUAGE C STRICT | ||
AS 'MODULE_PATHNAME', $$citus_shard_sizes$$; | ||
COMMENT ON FUNCTION pg_catalog.citus_shard_sizes(OUT table_name text, OUT size bigint) | ||
COMMENT ON FUNCTION pg_catalog.citus_shard_sizes(OUT shard_id int, OUT size bigint) | ||
IS 'returns shards sizes across citus cluster'; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.