Commit b194f2a
committed
MB-19641: Fix data race on ItemPager::phase
ItemPager::phase is accessed by multiple threads (when different
vbuckets are being processed by different executors), so it needs to
be atomic.
As reported by ThreadSanitizer:
WARNING: ThreadSanitizer: data race (pid=180366)
Read of size 4 at 0x7d1c0000d650 by thread T18 (mutexes: write M18437):
#0 PagingVisitor::visit(StoredValue*) ep-engine/src/item_pager.cc:86 (ep.so+0x000000107734)
#1 HashTable::visit(HashTableVisitor&) ep-engine/src/stored-value.cc:475 (ep.so+0x00000011d1b8)
couchbase#2 VBCBAdaptor::run() ep-engine/src/ep.cc:3929 (ep.so+0x0000000a3c2f)
couchbase#3 ExecutorThread::run() ep-engine/src/executorthread.cc:115 (ep.so+0x0000000fb086)
Previous write of size 4 at 0x7d1c0000d650 by thread T17:
#0 PagingVisitor::complete() ep-engine/src/item_pager.cc:179 (ep.so+0x000000108004)
#1 VBCBAdaptor::run() ep-engine/src/ep.cc:3937 (ep.so+0x0000000a3d7e)
couchbase#2 ExecutorThread::run() ep-engine/src/executorthread.cc:115 (ep.so+0x0000000fb086)
Change-Id: I9652a9f7f36f18967b6ec5903db53f3c7fb917fe
Reviewed-on: http://review.couchbase.org/64161
Tested-by: buildbot <build@couchbase.com>
Well-Formed: buildbot <build@couchbase.com>
Reviewed-by: Will Gardner <will.gardner@couchbase.com>1 parent 85c0728 commit b194f2a
2 files changed
Lines changed: 7 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | | - | |
62 | | - | |
| 61 | + | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
65 | 65 | | |
| |||
239 | 239 | | |
240 | 240 | | |
241 | 241 | | |
242 | | - | |
| 242 | + | |
243 | 243 | | |
244 | 244 | | |
245 | 245 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
79 | 82 | | |
80 | 83 | | |
81 | 84 | | |
| |||
0 commit comments