mirror of
https://github.com/postgres/postgres.git
synced 2026-04-09 02:56:13 -04:00
Remove isolation test lock-stats
This test is proving to be unstable in the CI for Windows, at least. The origin of the issue is that the deadlock_timeout requests may not be processed, causing the lock stats to not be updated. This could be mitigated by making the hardcoded sleep longer, however this would cost in runtime on fast machines. On slow machines, there is no guarantee that an augmented sleep would be enough. An isolation test may not be the best method to write this test (TAP test with injection point with a NOTICE+wait_for_log before processing the deadlock_timeout request should remove the need of a sleep). As we are late in the release cycle, I am removing the test for now to keep the CI and the buildfarm a maximum stable. Let's revisit this part later. Discussion: https://postgr.es/m/hlkdrplgrmudbspibsuq6xooxrqxqsgwo6x5b6x5ptvkgjbe7w@xogt6xgua6dz
This commit is contained in:
parent
11f8018ee6
commit
7c64d56fd9
3 changed files with 0 additions and 326 deletions
|
|
@ -1,197 +0,0 @@
|
|||
Parsed test spec with 2 sessions
|
||||
|
||||
starting permutation: s1_set_deadlock_timeout s1_reset_stat_lock s2_set_deadlock_timeout s1_begin s1_lock_relation s2_begin s2_ff s2_lock_relation s1_sleep s1_commit s2_commit s2_report_stat_lock_relation
|
||||
pg_stat_force_next_flush
|
||||
------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s1_set_deadlock_timeout: SET deadlock_timeout = '10ms';
|
||||
step s1_reset_stat_lock: SELECT pg_stat_reset_shared('lock');
|
||||
pg_stat_reset_shared
|
||||
--------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s2_set_deadlock_timeout: SET deadlock_timeout = '10ms';
|
||||
step s1_begin: BEGIN;
|
||||
step s1_lock_relation: LOCK TABLE test_stat_tab;
|
||||
step s2_begin: BEGIN;
|
||||
step s2_ff: SELECT pg_stat_force_next_flush();
|
||||
pg_stat_force_next_flush
|
||||
------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s2_lock_relation: LOCK TABLE test_stat_tab; <waiting ...>
|
||||
step s1_sleep: SELECT pg_sleep(0.05);
|
||||
pg_sleep
|
||||
--------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s1_commit: COMMIT;
|
||||
step s2_lock_relation: <... completed>
|
||||
step s2_commit: COMMIT;
|
||||
step s2_report_stat_lock_relation:
|
||||
SELECT waits > 0 AS has_waits, wait_time > 50 AS has_wait_time
|
||||
FROM pg_stat_lock WHERE locktype = 'relation';
|
||||
|
||||
has_waits|has_wait_time
|
||||
---------+-------------
|
||||
t |t
|
||||
(1 row)
|
||||
|
||||
|
||||
starting permutation: s1_set_deadlock_timeout s1_reset_stat_lock s2_set_deadlock_timeout s2_set_log_lock_waits s1_table_insert s1_begin s1_table_update_k1 s2_begin s2_ff s2_table_update_k1 s1_sleep s1_commit s2_commit s2_report_stat_lock_transactionid
|
||||
pg_stat_force_next_flush
|
||||
------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s1_set_deadlock_timeout: SET deadlock_timeout = '10ms';
|
||||
step s1_reset_stat_lock: SELECT pg_stat_reset_shared('lock');
|
||||
pg_stat_reset_shared
|
||||
--------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s2_set_deadlock_timeout: SET deadlock_timeout = '10ms';
|
||||
step s2_set_log_lock_waits: SET log_lock_waits = on;
|
||||
step s1_table_insert: INSERT INTO test_stat_tab(key, value) VALUES('k1', 1), ('k2', 1), ('k3', 1);
|
||||
step s1_begin: BEGIN;
|
||||
step s1_table_update_k1: UPDATE test_stat_tab SET value = value + 1 WHERE key = 'k1';
|
||||
step s2_begin: BEGIN;
|
||||
step s2_ff: SELECT pg_stat_force_next_flush();
|
||||
pg_stat_force_next_flush
|
||||
------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s2_table_update_k1: UPDATE test_stat_tab SET value = value + 1 WHERE key = 'k1'; <waiting ...>
|
||||
step s1_sleep: SELECT pg_sleep(0.05);
|
||||
pg_sleep
|
||||
--------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s1_commit: COMMIT;
|
||||
step s2_table_update_k1: <... completed>
|
||||
step s2_commit: COMMIT;
|
||||
step s2_report_stat_lock_transactionid:
|
||||
SELECT waits > 0 AS has_waits, wait_time > 50 AS has_wait_time
|
||||
FROM pg_stat_lock WHERE locktype = 'transactionid';
|
||||
|
||||
has_waits|has_wait_time
|
||||
---------+-------------
|
||||
t |t
|
||||
(1 row)
|
||||
|
||||
|
||||
starting permutation: s1_set_deadlock_timeout s1_reset_stat_lock s2_set_deadlock_timeout s2_set_log_lock_waits s1_lock_advisory_lock s2_begin s2_ff s2_lock_advisory_lock s1_sleep s1_lock_advisory_unlock s2_lock_advisory_unlock s2_commit s2_report_stat_lock_advisory
|
||||
pg_stat_force_next_flush
|
||||
------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s1_set_deadlock_timeout: SET deadlock_timeout = '10ms';
|
||||
step s1_reset_stat_lock: SELECT pg_stat_reset_shared('lock');
|
||||
pg_stat_reset_shared
|
||||
--------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s2_set_deadlock_timeout: SET deadlock_timeout = '10ms';
|
||||
step s2_set_log_lock_waits: SET log_lock_waits = on;
|
||||
step s1_lock_advisory_lock: SELECT pg_advisory_lock(1);
|
||||
pg_advisory_lock
|
||||
----------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s2_begin: BEGIN;
|
||||
step s2_ff: SELECT pg_stat_force_next_flush();
|
||||
pg_stat_force_next_flush
|
||||
------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s2_lock_advisory_lock: SELECT pg_advisory_lock(1); <waiting ...>
|
||||
step s1_sleep: SELECT pg_sleep(0.05);
|
||||
pg_sleep
|
||||
--------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s1_lock_advisory_unlock: SELECT pg_advisory_unlock(1);
|
||||
pg_advisory_unlock
|
||||
------------------
|
||||
t
|
||||
(1 row)
|
||||
|
||||
step s2_lock_advisory_lock: <... completed>
|
||||
pg_advisory_lock
|
||||
----------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s2_lock_advisory_unlock: SELECT pg_advisory_unlock(1);
|
||||
pg_advisory_unlock
|
||||
------------------
|
||||
t
|
||||
(1 row)
|
||||
|
||||
step s2_commit: COMMIT;
|
||||
step s2_report_stat_lock_advisory:
|
||||
SELECT waits > 0 AS has_waits, wait_time > 50 AS has_wait_time
|
||||
FROM pg_stat_lock WHERE locktype = 'advisory';
|
||||
|
||||
has_waits|has_wait_time
|
||||
---------+-------------
|
||||
t |t
|
||||
(1 row)
|
||||
|
||||
|
||||
starting permutation: s1_set_deadlock_timeout s1_reset_stat_lock s2_set_deadlock_timeout s2_unset_log_lock_waits s1_begin s1_lock_relation s2_begin s2_ff s2_lock_relation s1_sleep s1_commit s2_commit s2_report_stat_lock_relation
|
||||
pg_stat_force_next_flush
|
||||
------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s1_set_deadlock_timeout: SET deadlock_timeout = '10ms';
|
||||
step s1_reset_stat_lock: SELECT pg_stat_reset_shared('lock');
|
||||
pg_stat_reset_shared
|
||||
--------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s2_set_deadlock_timeout: SET deadlock_timeout = '10ms';
|
||||
step s2_unset_log_lock_waits: SET log_lock_waits = off;
|
||||
step s1_begin: BEGIN;
|
||||
step s1_lock_relation: LOCK TABLE test_stat_tab;
|
||||
step s2_begin: BEGIN;
|
||||
step s2_ff: SELECT pg_stat_force_next_flush();
|
||||
pg_stat_force_next_flush
|
||||
------------------------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s2_lock_relation: LOCK TABLE test_stat_tab; <waiting ...>
|
||||
step s1_sleep: SELECT pg_sleep(0.05);
|
||||
pg_sleep
|
||||
--------
|
||||
|
||||
(1 row)
|
||||
|
||||
step s1_commit: COMMIT;
|
||||
step s2_lock_relation: <... completed>
|
||||
step s2_commit: COMMIT;
|
||||
step s2_report_stat_lock_relation:
|
||||
SELECT waits > 0 AS has_waits, wait_time > 50 AS has_wait_time
|
||||
FROM pg_stat_lock WHERE locktype = 'relation';
|
||||
|
||||
has_waits|has_wait_time
|
||||
---------+-------------
|
||||
t |t
|
||||
(1 row)
|
||||
|
||||
|
|
@ -43,7 +43,6 @@ test: eval-plan-qual-trigger
|
|||
test: inplace-inval
|
||||
test: intra-grant-inplace
|
||||
test: intra-grant-inplace-db
|
||||
test: lock-stats
|
||||
test: lock-update-delete
|
||||
test: lock-update-traversal
|
||||
test: inherit-temp
|
||||
|
|
|
|||
|
|
@ -1,128 +0,0 @@
|
|||
# Test for the lock statistics
|
||||
#
|
||||
# This test creates multiple locking situations when a session (s2) has to
|
||||
# wait on a lock for longer than deadlock_timeout. The first permutations
|
||||
# test various lock tags. The last permutation checks that log_lock_waits
|
||||
# has no impact on the statistics counters.
|
||||
|
||||
setup
|
||||
{
|
||||
CREATE TABLE test_stat_tab(key text not null, value int);
|
||||
INSERT INTO test_stat_tab(key, value) VALUES('k0', 1);
|
||||
SELECT pg_stat_force_next_flush();
|
||||
}
|
||||
|
||||
teardown
|
||||
{
|
||||
DROP TABLE IF EXISTS test_stat_tab;
|
||||
}
|
||||
|
||||
session s1
|
||||
setup { SET stats_fetch_consistency = 'none'; }
|
||||
step s1_begin { BEGIN; }
|
||||
step s1_commit { COMMIT; }
|
||||
step s1_table_insert { INSERT INTO test_stat_tab(key, value) VALUES('k1', 1), ('k2', 1), ('k3', 1);}
|
||||
step s1_table_update_k1 { UPDATE test_stat_tab SET value = value + 1 WHERE key = 'k1';}
|
||||
step s1_set_deadlock_timeout { SET deadlock_timeout = '10ms'; }
|
||||
step s1_reset_stat_lock { SELECT pg_stat_reset_shared('lock'); }
|
||||
step s1_sleep { SELECT pg_sleep(0.05); }
|
||||
step s1_lock_relation { LOCK TABLE test_stat_tab; }
|
||||
step s1_lock_advisory_lock { SELECT pg_advisory_lock(1); }
|
||||
step s1_lock_advisory_unlock { SELECT pg_advisory_unlock(1); }
|
||||
|
||||
session s2
|
||||
setup { SET stats_fetch_consistency = 'none'; }
|
||||
step s2_begin { BEGIN; }
|
||||
step s2_commit { COMMIT; }
|
||||
step s2_ff { SELECT pg_stat_force_next_flush(); }
|
||||
step s2_table_update_k1 { UPDATE test_stat_tab SET value = value + 1 WHERE key = 'k1';}
|
||||
step s2_set_deadlock_timeout { SET deadlock_timeout = '10ms'; }
|
||||
step s2_set_log_lock_waits { SET log_lock_waits = on; }
|
||||
step s2_unset_log_lock_waits { SET log_lock_waits = off; }
|
||||
step s2_report_stat_lock_relation {
|
||||
SELECT waits > 0 AS has_waits, wait_time > 50 AS has_wait_time
|
||||
FROM pg_stat_lock WHERE locktype = 'relation';
|
||||
}
|
||||
step s2_report_stat_lock_transactionid {
|
||||
SELECT waits > 0 AS has_waits, wait_time > 50 AS has_wait_time
|
||||
FROM pg_stat_lock WHERE locktype = 'transactionid';
|
||||
}
|
||||
step s2_report_stat_lock_advisory {
|
||||
SELECT waits > 0 AS has_waits, wait_time > 50 AS has_wait_time
|
||||
FROM pg_stat_lock WHERE locktype = 'advisory';
|
||||
}
|
||||
step s2_lock_relation { LOCK TABLE test_stat_tab; }
|
||||
step s2_lock_advisory_lock { SELECT pg_advisory_lock(1); }
|
||||
step s2_lock_advisory_unlock { SELECT pg_advisory_unlock(1); }
|
||||
|
||||
######################
|
||||
# Lock stats tests
|
||||
######################
|
||||
|
||||
# relation lock
|
||||
|
||||
permutation
|
||||
s1_set_deadlock_timeout
|
||||
s1_reset_stat_lock
|
||||
s2_set_deadlock_timeout
|
||||
s1_begin
|
||||
s1_lock_relation
|
||||
s2_begin
|
||||
s2_ff
|
||||
s2_lock_relation
|
||||
s1_sleep
|
||||
s1_commit
|
||||
s2_commit
|
||||
s2_report_stat_lock_relation
|
||||
|
||||
# transaction lock
|
||||
|
||||
permutation
|
||||
s1_set_deadlock_timeout
|
||||
s1_reset_stat_lock
|
||||
s2_set_deadlock_timeout
|
||||
s2_set_log_lock_waits
|
||||
s1_table_insert
|
||||
s1_begin
|
||||
s1_table_update_k1
|
||||
s2_begin
|
||||
s2_ff
|
||||
s2_table_update_k1
|
||||
s1_sleep
|
||||
s1_commit
|
||||
s2_commit
|
||||
s2_report_stat_lock_transactionid
|
||||
|
||||
# advisory lock
|
||||
|
||||
permutation
|
||||
s1_set_deadlock_timeout
|
||||
s1_reset_stat_lock
|
||||
s2_set_deadlock_timeout
|
||||
s2_set_log_lock_waits
|
||||
s1_lock_advisory_lock
|
||||
s2_begin
|
||||
s2_ff
|
||||
s2_lock_advisory_lock
|
||||
s1_sleep
|
||||
s1_lock_advisory_unlock
|
||||
s2_lock_advisory_unlock
|
||||
s2_commit
|
||||
s2_report_stat_lock_advisory
|
||||
|
||||
# Ensure log_lock_waits has no impact
|
||||
|
||||
permutation
|
||||
s1_set_deadlock_timeout
|
||||
s1_reset_stat_lock
|
||||
s2_set_deadlock_timeout
|
||||
s2_unset_log_lock_waits
|
||||
s1_begin
|
||||
s1_lock_relation
|
||||
s2_begin
|
||||
s2_ff
|
||||
s2_lock_relation
|
||||
s1_sleep
|
||||
s1_commit
|
||||
s2_commit
|
||||
s2_report_stat_lock_relation
|
||||
Loading…
Reference in a new issue