-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cdc: avoid deadlock on error in pubsub sink #88289
cdc: avoid deadlock on error in pubsub sink #88289
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @HonoreDB and @shermanCRL)
pkg/ccl/changefeedccl/sink_pubsub.go
line 362 at r1 (raw file):
} p.mu.Unlock() // openTopic may need the lock to record an error topic, err := p.openTopic(name)
openTopic seems to only be called from this function and record error is only called from openTopic; why not just rename openTopic to openTopicLocked (and possible recordError to recordErrorLocked)?
c46a9d0
to
4a3f357
Compare
cockroachdb#88130 introduced a deadlock when an attempt to create a topic fails -- the goroutine tries to acquire a lock in order to record the error, but it already has it in order to write to the map. This PR releases the lock while creating the topic, which should also help with performance a bit on startup. Release note (bug fix): Fixed a bug preventing pubsub changefeeds from retrying.
4a3f357
to
00a4abe
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @miretskiy and @shermanCRL)
pkg/ccl/changefeedccl/sink_pubsub.go
line 362 at r1 (raw file):
Previously, miretskiy (Yevgeniy Miretskiy) wrote…
openTopic seems to only be called from this function and record error is only called from openTopic; why not just rename openTopic to openTopicLocked (and possible recordError to recordErrorLocked)?
Done.
bors r+ |
Build succeeded: |
#88130 introduced a deadlock when an attempt to create a
topic fails -- the goroutine tries to acquire a lock in order to record the error, but it already has it in order to write to the map. This PR releases the lock while creating the topic, which should also help with performance a bit on startup.
Fixes #85374
Release note (bug fix): Fixed a bug preventing pubsub changefeeds from retrying.