Skip to content
Snippets Groups Projects
Commit 882127fe authored by Marcin's avatar Marcin
Browse files

eliminate state providers tables (and their shadows) from hash computations

Currently state providers creates tables in hafd schema. All tables in
hafd schemas are taken to db hash computation, but hashes for state
providers are computed differently, ans should not affect hafd hash
schema.
parent ccc1bd64
No related branches found
No related tags found
6 merge requests!627merge in fix for get_current_block_age,!626Fix get_current_block_age function to avoid healthcheck fails,!622merge develop to master,!599merge ( with merge commit) develop to master,!597Merge develop to master for release,!590issue #259 automaticly get tables to db hash computation
......@@ -326,10 +326,13 @@ AS
$BODY$
BEGIN
RETURN QUERY SELECT (hive_update.calculate_table_schema_hash( 'hafd', table_name)).*
FROM information_schema.tables
WHERE table_schema = 'hafd'
AND table_type = 'BASE TABLE';
RETURN QUERY SELECT (hive_update.calculate_table_schema_hash( 'hafd', ist.table_name)).*
FROM information_schema.tables ist
LEFT JOIN hafd.state_providers_registered spr ON ist.table_name ILIKE ANY( spr.tables )
WHERE ist.table_schema = 'hafd'
AND ist.table_type = 'BASE TABLE'
AND spr.tables IS NULL
AND ist.table_name NOT ILIKE 'shadow_hafd_%'; -- shadow tables, only possible for state providers
END;
$BODY$
;
......
......@@ -276,4 +276,13 @@ exec_sql "CREATE OR REPLACE FUNCTION hive.start_provider_keyauth( _context hafd.
;"
failswith 1 update_database
printf "\nTEST: Use state provider. This should pass\n"
prepare_database
exec_sql "CREATE SCHEMA workaround;
SELECT hive.app_create_context('workaround', 'workaround');
SELECT hive.app_state_provider_import( 'KEYAUTH', 'workaround' );
"
update_database
echo "Succeeded"
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment