Skip to content

Commit 9d3d710

Browse files
committed
docs(push): clarify acceptable enrollment overlap
Signed-off-by: Tom Brow <[email protected]>
1 parent 3164b25 commit 9d3d710

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

‎crates/buzz-db/src/runtime/push_enqueue.rs‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -158,9 +158,9 @@ async fn enqueue(pool: &PgPool, job: &Job) -> crate::Result<()> {
158158
.bind(crate::push::push_gate_lock_key(job.community))
159159
.execute(&mut *tx)
160160
.await?;
161-
// Do not enqueue solely because a lease first appeared after the
162-
// message arrived. Updates racing this check may drop a wake, which is
163-
// permitted by the best-effort contract; message storage is authoritative.
161+
// Compare recorded receipt/update times without imposing commit ordering.
162+
// Registration overlapping message arrival may send or suppress a wake.
163+
// This bounded job never scans historical messages on lease activation.
164164
sqlx::query(
165165
"INSERT INTO push_match_queue (community_id, event_id) \
166166
SELECT $1, $2 FROM events e \

‎crates/buzz-db/src/store/event_follow_up_postgres_tests.rs‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -998,8 +998,9 @@ async fn assert_async_isolation(db: &Db, community: CommunityId, keys: &Keys) {
998998
.unwrap();
999999
assert_eq!(match_count(&isolated, community, &healthy).await, 1);
10001000

1001-
// If activation finishes while a post-commit job waits, it must not create
1002-
// a wake solely for a lease that appeared after the message was received.
1001+
// Exercise the timestamp filter with a lease timestamp explicitly newer
1002+
// than this message. This is not a production activation-order regression:
1003+
// registration overlapping message arrival may send or suppress a wake.
10031004
let later = create_community(db.pool()).await;
10041005
let mut activation = db.pool().begin().await.unwrap();
10051006
sqlx::query("SELECT pg_advisory_xact_lock(hashtextextended($1, 0))")

‎docs/push-gateway-deployment.md‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,11 @@ reject or roll back a committed message, and there is no replay/backfill of
294294
in-memory work. Monitor `buzz_push_enqueue_total` by result (`completed`, `full`,
295295
`transaction_full`, `closed`, `error`, `timeout`, `shutdown`). `completed` includes
296296
jobs with no eligible lease. Database enqueue is conditional on a live event and
297-
an eligible lease last updated no later than event receipt. A concurrent lease
298-
update can suppress a notification under this best-effort contract.
297+
an eligible lease whose recorded update timestamp is no later than event receipt.
298+
These timestamps do not establish transaction commit order. When registration
299+
and message arrival overlap, either sending or suppressing the notification is
300+
acceptable; there is no exact enrollment-order guarantee. Activation never scans
301+
historical messages or deliberately backfills older notifications.
299302

300303
This isolation requires the overlap migration and updated writers. Old images
301304
and raw SQL writers can still run the legacy transactional trigger until replaced.

0 commit comments

Comments
 (0)