Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix racy assignment of rowset indexes
Fixes a Jenkins failure seen in build #749: I0617 22:40:14.869637 25346 tablet.cc:416] Compaction: entering phase 1 (flushing snapshot) I0617 22:40:14.870381 25345 tablet.cc:416] Compaction: entering phase 1 (flushing snapshot) I0617 22:40:14.870650 25345 diskrowset.cc:110] Opened CFile writer for column key[type='uint32'] at path /tmp/kudutest-1106/MultiThreadedTabletTest_1.DeleteAndReinsert.1371534007/tablet/rowset_0000000954.compact-tmp/col_0 I0617 22:40:14.870782 25345 diskrowset.cc:110] Opened CFile writer for column val[type='uint32'] at path /tmp/kudutest-1106/MultiThreadedTabletTest_1.DeleteAndReinsert.1371534007/tablet/rowset_0000000954.compact-tmp/col_1 I0617 22:40:14.870944 25345 diskrowset.cc:110] Opened CFile writer for column update_count[type='uint32'] at path /tmp/kudutest-1106/MultiThreadedTabletTest_1.DeleteAndReinsert.1371534007/tablet/rowset_0000000954.compact-tmp/col_2 F0617 22:40:14.870992 25346 mt-tablet-test.cc:242] Check failed: _s.ok() Bad status: IO error: /tmp/kudutest-1106/MultiThreadedTabletTest_1.DeleteAndReinsert.1371534007/tablet/rowset_0000000954.compact-tmp: File exists (error 17) In this case, a concurrent Flush and Compact ended up getting assigned rowset #954 due to a non-atomic and non-locked increment of next_rowset_idx. This commit changes it to be an Atomic variable using atomic increment. No new unit tests since this race is hard to trigger and an existing test caught it. Review: http://review.sf.cloudera.com/r/29324/
- Loading branch information