Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,6 @@ protected GridDhtLocalPartition localPartition() {
boolean deferred = false;
GridCacheVersion ver0 = null;

cctx.shared().database().checkpointReadLock();

lockEntry();

try {
Expand Down Expand Up @@ -494,8 +492,6 @@ protected GridDhtLocalPartition localPartition() {
}
finally {
unlockEntry();

cctx.shared().database().checkpointReadUnlock();
}

if (obsolete) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -589,18 +589,24 @@ IgniteInternalFuture<GridCacheReturn> lockAllAsync(
if (txEntry == null) {
GridDhtCacheEntry cached;

while (true) {
try {
cached = dhtCache.entryExx(key, topVer);
cctx.database().checkpointReadLock();

cached.unswap(read);
try {
while (true) {
try {
cached = dhtCache.entryExx(key, topVer);

break;
}
catch (GridCacheEntryRemovedException ignore) {
if (log.isDebugEnabled())
log.debug("Get removed entry: " + key);
cached.unswap(read);

break;
}
catch (GridCacheEntryRemovedException ignore) {
if (log.isDebugEnabled())
log.debug("Get removed entry: " + key);
}
}
} finally {
cctx.database().checkpointReadUnlock();
}

addActiveCache(dhtCache.context(), false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1251,29 +1251,29 @@ private boolean enlistWriteEntry(GridCacheContext cacheCtx,
GridCacheEntryEx entry = entryEx(cacheCtx, txKey, entryTopVer != null ? entryTopVer : topologyVersion());

try {
entry.unswap(false);

// Check if lock is being explicitly acquired by the same thread.
if (!implicit && cctx.kernalContext().config().isCacheSanityCheckEnabled() &&
entry.lockedByThread(threadId, xidVer)) {
throw new IgniteCheckedException("Cannot access key within transaction if lock is " +
"externally held [key=" + CU.value(cacheKey, cacheCtx, false) +
", entry=" + entry +
", xidVer=" + xidVer +
", threadId=" + threadId +
", locNodeId=" + cctx.localNodeId() + ']');
}

CacheObject old = null;
GridCacheVersion readVer = null;

if (optimistic() && !implicit()) {
try {
if (needReadVer) {
if (primaryLocal(entry)) {
cctx.database().checkpointReadLock();
cctx.database().checkpointReadLock();

try {
try {
entry.unswap(false);

// Check if lock is being explicitly acquired by the same thread.
if (!implicit && cctx.kernalContext().config().isCacheSanityCheckEnabled() &&
entry.lockedByThread(threadId, xidVer)) {
throw new IgniteCheckedException("Cannot access key within transaction if lock is " +
"externally held [key=" + CU.value(cacheKey, cacheCtx, false) +
", entry=" + entry +
", xidVer=" + xidVer +
", threadId=" + threadId +
", locNodeId=" + cctx.localNodeId() + ']');
}

if (optimistic() && !implicit()) {
try {
if (needReadVer) {
if (primaryLocal(entry)) {
EntryGetResult res = entry.innerGetVersioned(
null,
this,
Expand All @@ -1290,15 +1290,8 @@ private boolean enlistWriteEntry(GridCacheContext cacheCtx,
readVer = res.version();
}
}
finally {
cctx.database().checkpointReadUnlock();
}
}
}
else {
cctx.database().checkpointReadLock();

try {
else {
old = entry.innerGet(
null,
this,
Expand All @@ -1310,19 +1303,18 @@ private boolean enlistWriteEntry(GridCacheContext cacheCtx,
null,
keepBinary);
}
finally {
cctx.database().checkpointReadUnlock();
}
}
}
catch (ClusterTopologyCheckedException e) {
entry.touch();
catch (ClusterTopologyCheckedException e) {
entry.touch();

throw e;
throw e;
}
}
else
old = entry.rawGet();
} finally {
cctx.database().checkpointReadUnlock();
}
else
old = entry.rawGet();

final GridCacheOperation op = rmv ? DELETE :
entryProc != null ? TRANSFORM : old != null ? UPDATE : CREATE;
Expand Down Expand Up @@ -2391,21 +2383,28 @@ private <K, V> Collection<KeyCacheObject> enlistRead(
optimistic() ? accessPolicy(cacheCtx, txKey, expiryPlc) : null;

if (needReadVer) {
getRes = primaryLocal(entry) ?
entry.innerGetVersioned(
null,
this,
/*metrics*/true,
/*event*/true,
null,
resolveTaskName(),
accessPlc,
!deserializeBinary,
null) : null;
cctx.database().checkpointReadLock();

if (getRes != null) {
val = getRes.value();
readVer = getRes.version();
try {
getRes = primaryLocal(entry) ?
entry.innerGetVersioned(
null,
this,
/*metrics*/true,
/*event*/true,
null,
resolveTaskName(),
accessPlc,
!deserializeBinary,
null) : null;

if (getRes != null) {
val = getRes.value();
readVer = getRes.version();
}
}
finally {
cctx.database().checkpointReadUnlock();
}
}
else {
Expand Down
Loading