Skip to content

avoid clearing server in cache when scanner closed and interrupted#5313

Merged
keith-turner merged 1 commit intoapache:2.1from
keith-turner:server-clear
Feb 14, 2025
Merged

avoid clearing server in cache when scanner closed and interrupted#5313
keith-turner merged 1 commit intoapache:2.1from
keith-turner:server-clear

Conversation

@keith-turner
Copy link
Contributor

When the thread running an accumulo scanner is interrupted it may cause the server the scanner was reading from to be cleared from the cache. This can be disruptive in the case where the server is fine. This change makes a narrow exception to clearing the server from the cache for the case where the scanner was closed and an interrupt was seen. The reason this is so narrow is to avoid failing to invalidate the cache in the case where there is actually a problem with the server.

When the thread running an accumulo scanner is interrupted it may cause
the server the scanner was reading from to be cleared from the cache.
This can be disruptive in the case where the server is fine. This change
makes a narrow exception to clearing the server from the cache for the
case where the scanner was closed and an interrupt was seen.  The reason
this is so narrow is to avoid failing to invalidate the cache in the
case where there is actually a problem with the server.
Copy link
Contributor

@dlmarion dlmarion left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@dlmarion
Copy link
Contributor

dlmarion commented Feb 7, 2025

I looked at TabletServerBatchReaderIterator and am wondering if we should not invalidate the cache if the queryThreadPool is shutdown. I could not determine from looking at the code if that was needed or not.

@keith-turner
Copy link
Contributor Author

I looked at TabletServerBatchReaderIterator and am wondering if we should not invalidate the cache if the queryThreadPool is shutdown. I could not determine from looking at the code if that was needed or not.

I did not fully follow all the code, but if closing the batch scanner cause spurious exceptions in background threads which unnecessarily clear the cache then that would be a good change to make.

@keith-turner keith-turner marked this pull request as ready for review February 14, 2025 22:26
@keith-turner keith-turner merged commit 6555fc1 into apache:2.1 Feb 14, 2025
8 checks passed
@keith-turner keith-turner deleted the server-clear branch February 14, 2025 22:26
@ctubbsii ctubbsii added this to the 2.1.4 milestone Feb 14, 2025
@ctubbsii ctubbsii linked an issue Feb 14, 2025 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants