Skip to content

Commit

Permalink
kvevent: Avoid busy loop during out of quota
Browse files Browse the repository at this point in the history
Previous PR cockroachdb#87464 erroneously removed code to ensure
that consumer is notified about out of quota events
once.  Rectify this issue.

Release Justification: bug fix
Release note: None
  • Loading branch information
Yevgeniy Miretskiy committed Sep 10, 2022
1 parent bf3c895 commit c5bf0a8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/ccl/changefeedccl/kvevent/blocking_buffer.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,9 @@ func (b *blockingBuffer) pop() (e Event, ok bool, err error) {
// So, we issue the flush request to the consumer to ensure that we release some memory.
e = Event{flush: true}
ok = true
// Ensure we notify only once. If we're still out of quota,
// subsequent notifyOutOfQuota will reset this field.
b.mu.canFlush = false
}

if b.mu.drainCh != nil && b.mu.queue.empty() {
Expand Down

0 comments on commit c5bf0a8

Please sign in to comment.