Skip to content

Commit

Permalink
sweeper now holds a lock while processing tombstone queue
Browse files Browse the repository at this point in the history
  • Loading branch information
dschneider-pivotal committed Jul 5, 2016
1 parent f82a8ce commit 71318b6
Show file tree
Hide file tree
Showing 3 changed files with 181 additions and 172 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3672,12 +3672,15 @@ public final boolean removeTombstone(RegionEntry re, VersionHolder version, bool
synchronized(this._getOwner().getSizeGuard()) { // do this sync first; see bug 51985
synchronized (re) {
int entryVersion = re.getVersionStamp().getEntryVersion();
boolean isTombstone = re.isTombstone();
boolean isSameTombstone = (entryVersion == destroyedVersion && isTombstone);
if (isSameTombstone || (isTombstone && entryVersion < destroyedVersion)) {
if (!re.isTombstone() || entryVersion > destroyedVersion) {
if (logger.isTraceEnabled(LogMarker.TOMBSTONE_COUNT)) {
// logs are at info level for TomstoneService.DEBUG_TOMBSTONE_COUNT so customer doesn't have to use fine level
if (isSameTombstone) {
logger.trace(LogMarker.TOMBSTONE_COUNT,
"tombstone for {} was resurrected with v{}; destroyed version was v{}; count is {}; entryMap size is {}",
re.getKey(), re.getVersionStamp().getEntryVersion(), destroyedVersion, this._getOwner().getTombstoneCount(), size());
}
} else {
if (logger.isTraceEnabled(LogMarker.TOMBSTONE_COUNT)) {
if (entryVersion == destroyedVersion) {
// logging this can put tremendous pressure on the log writer in tests
// that "wait for silence"
logger.trace(LogMarker.TOMBSTONE_COUNT,
Expand Down Expand Up @@ -3712,12 +3715,6 @@ public final boolean removeTombstone(RegionEntry re, VersionHolder version, bool
//if the region has been destroyed, the tombstone is already
//gone. Catch an exception to avoid an error from the GC thread.
}
} else {
if (logger.isTraceEnabled(LogMarker.TOMBSTONE_COUNT)) {
logger.trace(LogMarker.TOMBSTONE_COUNT,
"tombstone for {} was resurrected with v{}; destroyed version was v{}; count is {}; entryMap size is {}",
re.getKey(), re.getVersionStamp().getEntryVersion(), destroyedVersion, this._getOwner().getTombstoneCount(), size());
}
}
}
}
Expand Down
Loading

0 comments on commit 71318b6

Please sign in to comment.