-
Notifications
You must be signed in to change notification settings - Fork 284
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
postgres watch: checkpoints should move the high watermark revision
In #2139 we introduced the emission of checkpoint RevisionChanges when the postgres snapshot moves up out of band (outside of application changes). The fix missed to also move the locally-cached high watermark revision. As a consequence, on a PG-backed SpiceDB were the pg snapshot does not have an associated SpiceDB transaction, the Watch API will emit checkpoints at the same revision over and over, because its own internal high watermark hasn't moved. This changes the code so that `currentTxn`, which keeps track of the last checked revision, moves as well with an out-of-band snapshot revision.
- Loading branch information
1 parent
5dc47f5
commit 5e4befa
Showing
2 changed files
with
17 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -201,6 +201,8 @@ func (pgd *pgDatastore) Watch( | |
}) { | ||
return | ||
} | ||
|
||
currentTxn = *optionalHeadRevision | ||
} | ||
} | ||
|
||
|