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

Make statistics's stats_level change thread-safe #5030

Closed
wants to merge 2 commits into from

Conversation

siying
Copy link
Contributor

@siying siying commented Feb 28, 2019

Summary:
Right now, users can change statistics.stats_level while DB is running, but TSAN may report
data race. We make stats_level_ to be atomic, and access them using accessors.

Test Plan: Run existing tests.

Summary:
Right now, users can change statistics.stats_level while DB is running, but TSAN may report
data race. We make stats_level_ to be atomic, and access them using accessors.

Test Plan: Run existing tests.
Copy link
Contributor

@riversand963 riversand963 left a comment

Choose a reason for hiding this comment

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

LGTM except a comment and test failures.

@@ -514,8 +514,16 @@ class Statistics {
virtual bool HistEnabledForType(uint32_t type) const {
return type < HISTOGRAM_ENUM_MAX;
}
void set_stats_level(StatsLevel sl) {
stats_level_.store(sl, std::memory_order_relaxed);
;
Copy link
Contributor

Choose a reason for hiding this comment

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

Remove this ';'

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.

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

@siying
Copy link
Contributor Author

siying commented Mar 1, 2019

vagogte pushed a commit to vagogte/rocksdb that referenced this pull request Jun 18, 2019
Summary:
Right now, users can change statistics.stats_level while DB is running, but TSAN may report
data race. We make stats_level_ to be atomic, and access them using accessors.
Pull Request resolved: facebook#5030

Differential Revision: D14267519

Pulled By: siying

fbshipit-source-id: 37d7ebeff7a43a406230143422a16af899163f73
suizman added a commit to suizman/qed that referenced this pull request Jul 11, 2019
suizman added a commit to suizman/qed that referenced this pull request Sep 23, 2019
Minor changes in statistics -> facebook/rocksdb#5030
Remove some functiones in our extended bindings which are no more
required by this new version of Rocksdb

Related BBVA#114
suizman added a commit to suizman/qed that referenced this pull request Sep 25, 2019
Minor changes in statistics -> facebook/rocksdb#5030
Remove some functiones in our extended bindings which are no more
required by this new version of Rocksdb

Related BBVA#114
suizman added a commit to suizman/qed that referenced this pull request Sep 26, 2019
Minor changes in statistics -> facebook/rocksdb#5030
Remove some functiones in our extended bindings which are no more
required by this new version of Rocksdb

Related BBVA#114
suizman added a commit to BBVA/qed that referenced this pull request Sep 30, 2019
Minor changes in statistics -> facebook/rocksdb#5030
Remove some functiones in our extended bindings which are no more
required by this new version of Rocksdb

Related #114


Former-commit-id: 71e024c
suizman added a commit to BBVA/qed that referenced this pull request Sep 30, 2019
Minor changes in statistics -> facebook/rocksdb#5030
Remove some functiones in our extended bindings which are no more
required by this new version of Rocksdb

Related #114


Former-commit-id: bfe2771 [formerly 71e024c]
Former-commit-id: 3248422
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.

None yet

3 participants