Skip to content

Commit

Permalink
Fix race condition in TSTabletManager::GenerateFullTabletReport
Browse files Browse the repository at this point in the history
Summary:
dirty_tablets_ is accessed w/o lock.
Fixed that.

Test Plan: ybd tsan --cxx-test integration-tests_registration-test --gtest_filter RegistrationTest.TestTabletReports -n 100

Reviewers: mikhail, amitanand, timur

Reviewed By: timur

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D4743
  • Loading branch information
spolitov committed May 3, 2018
1 parent 22bd29c commit 23bb34b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/yb/tserver/ts_tablet_manager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1233,6 +1233,8 @@ void TSTabletManager::GenerateFullTabletReport(TabletReportPB* report) {
for (const auto& replica : to_report) {
CreateReportedTabletPB(replica, report->add_updated_tablets());
}

std::lock_guard<RWMutex> l(lock_);
dirty_tablets_.clear();
}

Expand Down

0 comments on commit 23bb34b

Please sign in to comment.