Skip to content
Open
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 @@ -2395,7 +2395,14 @@ private boolean checkExpired() throws IgniteCheckedException {
long delta = expireTime - U.currentTimeMillis();

if (delta <= 0) {
removeValue();
cctx.shared().database().checkpointReadLock();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. do we really need this lock ?
  2. can we cover with appropriate test such a case for defence in future ?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we have that test - IgniteOfflineBaselineNodeFullApiSelfTest, it crashes all the time and this is a fix for it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure such easy fix is a proper solution.
The question is why none of 16 cctx.shared().database().checkpointReadLock(); usages helped.

The solution is not to hold lock, but to understand why it's not held.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The call starts from org.apache.ignite.internal.processors.cache.GridCacheAdapter.GlobalClearAllJob - this job is cleaning out expired objects from a cache and it starts without any locks with direct access to a cache. In any case it should add overall stability for all tests

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still see no answer why none of 16 cctx.shared().database().checkpointReadLock(); usages helped.


try {
removeValue();
}
finally {
cctx.shared().database().checkpointReadUnlock();
}

return true;
}
Expand Down Expand Up @@ -3535,8 +3542,15 @@ protected WALPointer logTxUpdate(
protected void removeValue() throws IgniteCheckedException {
assert lock.isHeldByCurrentThread();

// Removals are possible from RENTING partition on clearing/evicting.
cctx.offheap().remove(cctx, key, partition(), localPartition());
cctx.shared().database().checkpointReadLock();

try {
// Removals are possible from RENTING partition on clearing/evicting.
cctx.offheap().remove(cctx, key, partition(), localPartition());
}
finally {
cctx.shared().database().checkpointReadUnlock();
}
}

/** {@inheritDoc} */
Expand Down
Loading