Skip to content
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

Fix deadlock when running backup #6006

Merged
merged 2 commits into from Mar 14, 2016
Merged

Fix deadlock when running backup #6006

merged 2 commits into from Mar 14, 2016

Conversation

jwilder
Copy link
Contributor

@jwilder jwilder commented Mar 14, 2016

  • CHANGELOG.md updated
  • Rebased/mergable
  • Tests pass
  • Sign CLA (if not already signed)

A deadlock occurs under write load if a backup is run in between the
time when a snapshot compactions has snapshotted the cache and successfully
written it to disk. The issus is that the second snapshot call will block
on the commit lock while it is holding the engine write lock. This causes
all writes to block as well as prevents the currently runnign snapshot
compaction from completing because it needs to acquire a read-lock.

This PR removes the commit lock and just returns an error if a snapshot is
in progress to all any locks being held to be released. The caller can determine
whether to retry or giveup.

A deadlock occurs under write load if a backup is run in between the
time when a snapshot compactions has snapshotted the cache and successfully
written it to disk.  The issus is that the second snapshot call will block
on the commit lock while it is holding the engine write lock.  This causes
all writes to block as well as prevents the currently runnign snapshot
compaction from completing because it needs to acquire a read-lock.

This PR removes the commit lock and just returns an error if a snapshot is
in progress to all any locks being held to be released.  The caller can determine
whether to retry or giveup.
@jsternberg
Copy link
Contributor

👍 LGTM

jwilder added a commit that referenced this pull request Mar 14, 2016
Fix deadlock when running backup
@jwilder jwilder merged commit 3fd40d4 into master Mar 14, 2016
@jwilder jwilder deleted the jw-deadlock branch March 14, 2016 19:36
@jonseymour
Copy link
Contributor

Oops, apologies @jwilder for not spotting this consequence.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants