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

Avoid deadlock between mutex_ and log_write_mutex_ (#5437) #35

Merged
merged 1 commit into from
Jun 14, 2019

Conversation

ajkr
Copy link

@ajkr ajkr commented Jun 14, 2019

Summary:
To avoid deadlock mutex_ should never be acquired before log_write_mutex_. The patch documents that and also fixes one case in ::FlushWAL that acquires mutex_ through ::WriteStatusCheck when it already holds lock on log_write_mutex_.
Pull Request resolved: facebook#5437

Differential Revision: D15749722

Pulled By: maysamyabandeh

fbshipit-source-id: f57b69c44b4b80cc6d7ddf3d3fdf4a9eb5a5a45a


This change is Reviewable

Summary:
To avoid deadlock mutex_ should never be acquired before log_write_mutex_. The patch documents that and also fixes one case in ::FlushWAL that acquires mutex_ through ::WriteStatusCheck when it already holds lock on log_write_mutex_.
Pull Request resolved: facebook#5437

Differential Revision: D15749722

Pulled By: maysamyabandeh

fbshipit-source-id: f57b69c44b4b80cc6d7ddf3d3fdf4a9eb5a5a45a
@ajkr ajkr merged commit 12db615 into crl-release-5.17.2 Jun 14, 2019
ajkr added a commit to ajkr/cockroach that referenced this pull request Jun 23, 2019
Includes the following changes, all of which have landed upstream.

- cockroachdb/rocksdb#32: "Fix merging range tombstone covering put during flush/compaction"
- cockroachdb/rocksdb#33: "Dynamic test whether sync_file_range returns ENOSYS"
- cockroachdb/rocksdb#34: "Potential fix for stress test failure due to "SST file ahead of WAL" error"
- cockroachdb/rocksdb#35: "Avoid deadlock between mutex_ and log_write_mutex_"

Fixes cockroachdb#37752.

Release note (bug fix): Fixed possible deadlock when storage engine
write fails.

Release note (bug fix): Fixed potential reappearance of deleted
timeseries data, which could trip consistency checker.

Release note (bug fix): Removed dependency on `sync_file_range` on
Linux platforms on which it returns `ENOSYS`, such as WSL (Windows
Subsystem for Linux).
craig bot pushed a commit to cockroachdb/cockroach that referenced this pull request Jun 23, 2019
38170: c-deps: bump rocksdb for multiple backported PRs r=ajkr a=ajkr

Includes the following changes, all of which have landed upstream.

- cockroachdb/rocksdb#32: "Fix merging range tombstone covering put during flush/compaction"
- cockroachdb/rocksdb#33: "Dynamic test whether sync_file_range returns ENOSYS"
- cockroachdb/rocksdb#34: "Potential fix for stress test failure due to "SST file ahead of WAL" error"
- cockroachdb/rocksdb#35: "Avoid deadlock between mutex_ and log_write_mutex_"

Fixes #37752.

Release note (bug fix): Fixed possible deadlock when storage engine
write fails.

Release note (bug fix): Fixed potential reappearance of deleted
timeseries data, which could trip consistency checker.

Release note (bug fix): Removed dependency on `sync_file_range` on
Linux platforms on which it returns `ENOSYS`, such as WSL (Windows
Subsystem for Linux).

Co-authored-by: Andrew Kryczka <andrew.kryczka2@gmail.com>
ajkr added a commit to ajkr/cockroach that referenced this pull request Jun 26, 2019
Includes the following changes, all of which have landed upstream.

- cockroachdb/rocksdb#32: "Fix merging range tombstone covering put during flush/compaction"
- cockroachdb/rocksdb#33: "Dynamic test whether sync_file_range returns ENOSYS"
- cockroachdb/rocksdb#34: "Potential fix for stress test failure due to "SST file ahead of WAL" error"
- cockroachdb/rocksdb#35: "Avoid deadlock between mutex_ and log_write_mutex_"

Fixes cockroachdb#37752.

Release note (bug fix): Fixed possible deadlock when storage engine
write fails.

Release note (bug fix): Fixed potential reappearance of deleted
timeseries data, which could trip consistency checker.

Release note (bug fix): Removed dependency on `sync_file_range` on
Linux platforms on which it returns `ENOSYS`, such as WSL (Windows
Subsystem for Linux).
ajkr added a commit to ajkr/cockroach that referenced this pull request Jun 26, 2019
Includes clean backports of the following changes, which have landed
upstream.

- cockroachdb/rocksdb#32: "Fix merging range tombstone covering put during flush/compaction"
- cockroachdb/rocksdb#35: "Avoid deadlock between mutex_ and log_write_mutex_"

Includes an unclean backport of the below change, which has landed
upstream. This unclean backport _has not been reviewed_.

- cockroachdb/rocksdb#33: "Dynamic test whether sync_file_range returns ENOSYS" (cockroachdb/rocksdb@630e08e)

Release note (bug fix): Fixed possible deadlock when storage engine
write fails.

Release note (bug fix): Fixed potential reappearance of deleted
timeseries data, which could trip consistency checker.

Release note (bug fix): Removed dependency on sync_file_range on
Linux platforms on which it returns ENOSYS, such as WSL (Windows
Subsystem for Linux).
craig bot pushed a commit to cockroachdb/cockroach that referenced this pull request Jun 27, 2019
38478: release 19.1: c-deps: bump rocksdb for multiple backported PRs r=ajkr a=ajkr

Includes clean backports of the following changes, which have landed
upstream.

- cockroachdb/rocksdb#32: "Fix merging range tombstone covering put during flush/compaction"
- cockroachdb/rocksdb#35: "Avoid deadlock between mutex_ and log_write_mutex_"

Includes an unclean backport of the below change, which has landed
upstream. This unclean backport _has not been reviewed_.

- cockroachdb/rocksdb#33: "Dynamic test whether sync_file_range returns ENOSYS" (backport commit: cockroachdb/rocksdb@630e08e)

Release note (bug fix): Fixed possible deadlock when storage engine
write fails.

Release note (bug fix): Fixed potential reappearance of deleted
timeseries data, which could trip consistency checker.

Release note (bug fix): Removed dependency on sync_file_range on
Linux platforms on which it returns ENOSYS, such as WSL (Windows
Subsystem for Linux).

Co-authored-by: Andrew Kryczka <andrew.kryczka2@gmail.com>
@ajkr ajkr deleted the backport-pr5437 branch June 27, 2019 22:00
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

2 participants