Skip to content

Conversation

@miasantreble
Copy link
Contributor

Fix a TSAN failure in DBRangeDelTest.ValidLevelSubcompactionBoundaries:
https://gist.github.com/miasantreble/712e04b4de2ff7f193c98b1acf07e899

Test plan:

TEST_TMPDIR=/dev/shm/rocksdb OPT=-g COMPILE_WITH_TSAN=1 make J=64 -j64 db_range_del_test && ./db_range_del_test --gtest_filter=DBRangeDelTest.ValidLevelSubcompactionBoundaries

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miasantreble has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link
Contributor

@yiwu-arbug yiwu-arbug left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@miasantreble is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@miasantreble miasantreble deleted the fix-tsan-failure branch April 9, 2018 20:12
huachaohuang added a commit to tikv/rocksdb that referenced this pull request Oct 30, 2018
* Fix Get does not return super version on error

Summary:
This is caught when I was testing facebook#2886.
Closes facebook#2907

Differential Revision: D5863153

Pulled By: yiwu-arbug

fbshipit-source-id: 8c54759ba1a0dc101f24ab50423e35731300612d

* fix data race

Summary:
Fix a TSAN failure in `DBRangeDelTest.ValidLevelSubcompactionBoundaries`:
https://gist.github.com/miasantreble/712e04b4de2ff7f193c98b1acf07e899
Closes facebook#3691

Differential Revision: D7541400

Pulled By: miasantreble

fbshipit-source-id: b0b4538980bce7febd0385e61d6e046580bcaefb

* check return status for Sync() and Append() calls to avoid corruption

Summary:
Right now in `SyncClosedLogs`, `CopyFile`, and `AddRecord`, where `Sync` and `Append` are invoked in a loop, the error status are not checked. This could lead to potential corruption as later calls will overwrite the error status.
Closes facebook#3740

Differential Revision: D7678848

Pulled By: miasantreble

fbshipit-source-id: 4b0b412975989dfe80348f73217b9c4122a4bd77

* Fix race condition between log_.erase and log_.back

Summary:
log_ contract specifies that it should not be modified unless both mutex_ and log_write_mutex_ are held. log_.erase however does that with only holding mutex_. This causes a race condition with two_write_queues since logs_.back is read with holding only log_write_mutex_ (which is correct according to logs_ contract) but logs_.erase is called concurrently. This is probably the cause of logs_.back returning nullptr in facebook#3852 although I could not reproduce it.
Fixes facebook#3852
Closes facebook#3859

Differential Revision: D8026103

Pulled By: maysamyabandeh

fbshipit-source-id: ee394e00fe4aa520d884c5ef87981e9d6b5ccb28

* Sync CURRENT file during checkpoint (facebook#4322)

Summary: For the CURRENT file forged during checkpoint, we were forgetting to `fsync` or `fdatasync` it after its creation. This PR fixes it.

Differential Revision: D9525939

Pulled By: ajkr

fbshipit-source-id: a505483644026ee3f501cfc0dcbe74832165b2e3
ttyusupov added a commit to yugabyte/yugabyte-db that referenced this pull request Nov 1, 2024
Summary:
Sometimes auto-compactions could be enabled on RocksDB instance concurrently with another thread is deleting intent SST files.
This translates to concurrent RocksDB instance options change and accessing those options from `VersionSet::LogAndApply`.
For performance reasons `VersionSet::LogAndApply` is calling `Version::PrepareApply` outside of DB mutex and this reads RocksDB options causing data race.

Added `DeleteFileTest.DeleteWithConcurrentOptionsChange` for reproducing this issue reliably in RocksDB itself. Then found that original RocksDB also had this issue and ported the fix from: facebook/rocksdb#3691
Jira: DB-13133

Test Plan:
`ybd tsan --sj --gtest_filter DeleteFileTest.DeleteWithConcurrentOptionsChange -n 10 -- -p 1`
`ybd tsan --sj --gtest_filter PgCatalogVersionTest.SimulateUpgradeToPerdbMode -n 20 -- -p 1`

Reviewers: arybochkin

Reviewed By: arybochkin

Subscribers: ybase

Tags: #jenkins-ready

Differential Revision: https://phorge.dev.yugabyte.com/D39614
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants