wtclient: use the new filter options to fix the demo'd bug

In this commit, we use the newly added session listing options to ensure
that we only see a session as exhausted if it does not have any un-acked
updates on disk. This fixes the bug previously demonstrated.
This commit is contained in:
Elle Mouton committed 2024-01-12 08:25:28 +02:00
1 parent 776f2a026c
commit 1daec3e890
2 files changed
+30 -19

No files matched your search

+7 -3
View File
@@ -66,10 +66,14 @@ func (c *client) genSessionFilter(
}
// ExhaustedSessionFilter constructs a wtdb.ClientSessionFilterFn filter
// function that will filter out any sessions that have been exhausted.
// function that will filter out any sessions that have been exhausted. A
// session is considered exhausted only if it has no un-acked updates and the
// sequence number of the session is equal to the max updates of the session
// policy.
func ExhaustedSessionFilter() wtdb.ClientSessWithNumCommittedUpdatesFilterFn {
return func(session *wtdb.ClientSession, _ uint16) bool {
return session.SeqNum < session.Policy.MaxUpdates
return func(session *wtdb.ClientSession, numUnAcked uint16) bool {
return session.SeqNum < session.Policy.MaxUpdates ||
numUnAcked > 0
}
}