Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -104,10 +104,10 @@ step l2commit: COMMIT;
listener2: NOTIFY "c1" with payload "" from notifier
step l2stop: UNLISTEN *;

starting permutation: llisten lbegin usage bignotify usage
starting permutation: llisten lbegin yb_lusage bignotify yb_empty yb_lusage
step llisten: LISTEN c1; LISTEN c2;
step lbegin: BEGIN;
step usage: SELECT pg_notification_queue_usage() > 0 AS nonzero;
step yb_lusage: SELECT pg_notification_queue_usage() > 0 AS nonzero;
nonzero
-------
f
Expand All @@ -120,7 +120,8 @@ count
1000
(1 row)

step usage: SELECT pg_notification_queue_usage() > 0 AS nonzero;
step yb_empty:
step yb_lusage: SELECT pg_notification_queue_usage() > 0 AS nonzero;
nonzero
-------
t
Expand Down
11 changes: 8 additions & 3 deletions src/postgres/src/test/isolation/specs/yb.port.async-notify.spec
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ step notifys1 {
ROLLBACK TO SAVEPOINT s2;
COMMIT;
}
step usage { SELECT pg_notification_queue_usage() > 0 AS nonzero; }
step bignotify { SELECT count(pg_notify('c1', s::text)) FROM generate_series(1, 1000) s; }
step yb_empty {}
teardown { UNLISTEN *; }

# The listener session is used for cross-backend notify checks.
Expand All @@ -43,6 +43,7 @@ step lcheck { SELECT 1 AS x; }
step lbegin { BEGIN; }
step lbegins { BEGIN ISOLATION LEVEL SERIALIZABLE; }
step lcommit { COMMIT; }
step yb_lusage { SELECT pg_notification_queue_usage() > 0 AS nonzero; }
teardown { UNLISTEN *; }

# In some tests we need a second listener, just to block the queue.
Expand Down Expand Up @@ -81,10 +82,14 @@ permutation l2listen l2begin notify1 lbegins llisten lcommit l2commit l2stop
# commit the listener's transaction, so that it never reports these events.
# Hence, this should be the last test in this script.

# YB: In YB, any operation taking longer than
# YB:
# In YB, any operation taking longer than
# YB_NUM_SECONDS_TO_WAIT_TO_ASSUME_SESSION_BLOCKED is deemed as waiting on the
# other session. The step 'bignotify' intermittently breaches this limit. To
# make the output deterministic, add (*) to bignotify to always report it as
# waiting.
#
# Also, in YB, listener and notifier can be in different nodes. Check queue
# usage on the listening node after bignotify completes.

permutation llisten lbegin usage bignotify(*) usage
permutation llisten lbegin yb_lusage bignotify(*) yb_empty yb_lusage
Loading