mirror of https://github.com/citusdata/citus.git
Check activate snapshot consistency between nodes in check_mx
parent
37fafd007c
commit
53e89e8d1f
|
@ -10,3 +10,29 @@ SELECT bool_and(metadatasynced) FROM pg_dist_node WHERE noderole = 'primary';
|
||||||
t
|
t
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
|
-- Create the necessary test utility function
|
||||||
|
CREATE OR REPLACE FUNCTION activate_node_snapshot()
|
||||||
|
RETURNS text[]
|
||||||
|
LANGUAGE C STRICT
|
||||||
|
AS 'citus';
|
||||||
|
-- Following tests capture the difference between the metadata in the worker nodes and the
|
||||||
|
-- coordinator. It is expected to see no rows. However if the tests fail, we list the
|
||||||
|
-- problematic queries in the activate_node_snapshot() result set.
|
||||||
|
-- list all metadata that is missing in the worker nodes
|
||||||
|
SELECT unnest(activate_node_snapshot())
|
||||||
|
EXCEPT
|
||||||
|
SELECT unnest(result::text[]) AS unnested_result
|
||||||
|
FROM run_command_on_workers($$SELECT activate_node_snapshot()$$);
|
||||||
|
unnest
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
(0 rows)
|
||||||
|
|
||||||
|
-- list all the metadata that is missing on the coordinator
|
||||||
|
SELECT unnest(result::text[]) AS unnested_result
|
||||||
|
FROM run_command_on_workers($$SELECT activate_node_snapshot()$$)
|
||||||
|
EXCEPT
|
||||||
|
SELECT unnest(activate_node_snapshot());
|
||||||
|
unnested_result
|
||||||
|
---------------------------------------------------------------------
|
||||||
|
(0 rows)
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,25 @@
|
||||||
SHOW citus.enable_metadata_sync;
|
SHOW citus.enable_metadata_sync;
|
||||||
|
|
||||||
SELECT bool_and(metadatasynced) FROM pg_dist_node WHERE noderole = 'primary';
|
SELECT bool_and(metadatasynced) FROM pg_dist_node WHERE noderole = 'primary';
|
||||||
|
|
||||||
|
-- Create the necessary test utility function
|
||||||
|
CREATE OR REPLACE FUNCTION activate_node_snapshot()
|
||||||
|
RETURNS text[]
|
||||||
|
LANGUAGE C STRICT
|
||||||
|
AS 'citus';
|
||||||
|
|
||||||
|
-- Following tests capture the difference between the metadata in the worker nodes and the
|
||||||
|
-- coordinator. It is expected to see no rows. However if the tests fail, we list the
|
||||||
|
-- problematic queries in the activate_node_snapshot() result set.
|
||||||
|
|
||||||
|
-- list all metadata that is missing in the worker nodes
|
||||||
|
SELECT unnest(activate_node_snapshot())
|
||||||
|
EXCEPT
|
||||||
|
SELECT unnest(result::text[]) AS unnested_result
|
||||||
|
FROM run_command_on_workers($$SELECT activate_node_snapshot()$$);
|
||||||
|
|
||||||
|
-- list all the metadata that is missing on the coordinator
|
||||||
|
SELECT unnest(result::text[]) AS unnested_result
|
||||||
|
FROM run_command_on_workers($$SELECT activate_node_snapshot()$$)
|
||||||
|
EXCEPT
|
||||||
|
SELECT unnest(activate_node_snapshot());
|
||||||
|
|
Loading…
Reference in New Issue