New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename GarbageCollectionLogger, optionally pause scans/compactions until memory usage is lower #3161
Rename GarbageCollectionLogger, optionally pause scans/compactions until memory usage is lower #3161
Conversation
Did you look at the changes proposed in #2827? With the current version there can be a synchronization issue and with a quick look I didn't see you change the initialization. I'm going to pull this down to look in more detail, but maybe you already addressed it? |
I didn't look at #2827 in the context of these changes. I'll review. |
I didn't really change GarbageCollectionLogger too much. I didn't remove the lock, so if that's the synchronization issue you are referring to, then I believe it's not an issue. |
@dlmarion - I do not understand your response. The previous GC code gets flagged by findbugs at the next compliance level above the level that we currently run. The code change that I proposed fixed that warning. I don't think you changed the instantiation code from the original - so I think that your code will also have the same warning / issue. If you took my initialization and moved the GC instantiation into the context I think it would resolve the findbugs warning / potential synchronization issue. Because you also renamed the GC, most of my PR is OBE, but the initialization change should still be valid. Or maybe another approach? |
I didn't understand your comment about there being a synchronization issue. I think I was missing that |
I will bump the compliance level on this branch and see what happens |
My point is you are changing the same code. Your code is an opportunity to correct the issue now rather than as a follow-on. |
Yep, I'm with you. I'll bump the compliance level on this branch and see what happens. |
Bumping the maxRank for FindBugs caused the build to fail in core, way before it reached the server code where the GarbageCollectionLogger code was. So, I removed the |
…the LowMemoryDetector object in the other constructors of TabletIteratorEnvironment. These other constructors are used by minc and majc processes. I didn't wire up the LowMemoryDetector to pause minc/majc compaction processes at this point (could be done in FileCompactor.compact() for majc), but the information is available to compaction iterators that extend WrappingIterator.
In testing this, I have seen the ITs hang twice, for at least 8 hours each before I terminated the build. I have not investigated to determine what is causing the problem. It may be unrelated, and a mere coincidence, but I have not seen it happen with other builds recently. |
Kicked off a new IT build. I don't believe that your test runs had my latest changes. 2/3 of my IT's have passed as of this point. 🤞 |
IT build passed |
core/src/main/java/org/apache/accumulo/core/client/admin/ActiveCompaction.java
Outdated
Show resolved
Hide resolved
@keith-turner - could you take a look at this when you get a chance? I talked with @ctubbsii and he said he had not objection to including in 3.0, wanted to get your input before I merge. |
Resolved conflicts and kicked off another full IT build. |
server/base/src/main/java/org/apache/accumulo/server/mem/LowMemoryDetector.java
Outdated
Show resolved
Hide resolved
server/base/src/main/java/org/apache/accumulo/server/mem/LowMemoryDetector.java
Show resolved
Hide resolved
server/tserver/src/main/java/org/apache/accumulo/tserver/tablet/TabletBase.java
Outdated
Show resolved
Hide resolved
Made logging less verbose in the normal case and more specific in the recovery case. Modified interface to throw InterruptedException in the case where the action performed a sleep so that the calling thread could handle / raise the exception. Change the use of uninterruptible sleep to Thread.sleep in Action implementations.
Full IT build passed |
Accumulo has had a GarbageCollectionLogger for a long time. Currently it runs every 5 seconds in the server processes and logs a message that memory is low when the amount of free memory is less than 5% of the heap.
This PR modifies the GarbageCollectionLogger to optionally take a more active role. This PR:
lookup
andnextBatch
methods inTabletBase
such that:a. if low memory at the entrance to the method, it waits until that condition no longer exists
b. if low memory while aggregating results, it returns the batch of results early (similar to time limit or batch limit being exceeded)
a. Added
isRunningLowOnMemory()
to SKVI interface, default implementation returnsfalse
b. Modiifed WrappingIterator to implement
isRunningLowOnMemory()
using the LowMemoryDetector.