-
Notifications
You must be signed in to change notification settings - Fork 478
Reliably refresh tablets after updating tablet files for a compaction. #3563
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
Conversation
This commit modifies the compaction coordinator to reliably refresh hosted tablets in memory metadata after a compaction. The RPC request to a hosted tablet asking it to refresh happens after updating a tablets metadata for a compaction. The changes in the PR ensure that if the manager process dies after making the metadata update but before it makes the RPC that this will happen when the manager restarts. The implementation for this relies on a new ~refresh sections in the metadata table. System compactions on hosted tablets will write a ~refresh entry before trying to update a tablets metadata. This entry allows the compaction commit process to be fault tolerant. Javadoc was added to CompactionCoordinator.compactionCompleted() describing the overall process of committing a compaction. This commit also refactored the refresh RPC code in bulk import so that it could also be used by compactions. This commit also made the tablet metadata update for a compaction add scan entries for removed files when a tablet is hosted. This was done to prevent the Accumulo GC from removing compacted files that may be in use by an immediate scan. fixes apache#3462
ZK is not very scalable in terms of writes (I think each write goes to the leader which then forwards it to all other ZK servers and waits for a majority to respond). This potential write bottleneck seem like an issue when considering it as an option for signaling tablet metadata refresh. As for the tablet metadata update in the tablet server I have not had a chance to look into it in detail. Some of the issues that I know will arise for refresh off the top of my head are :
The tablet server code has synchronization around bulk import, compactions, and splits that can be remove. I am thinking after we remove that code we can evaluate what needs are left and look into simplifying the tablets synchronization model that refresh will have to fit into. |
DomGarguilo
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far from what I can tell. Just a few minor comments/suggestions.
core/src/main/java/org/apache/accumulo/core/metadata/schema/Ample.java
Outdated
Show resolved
Hide resolved
server/base/src/main/java/org/apache/accumulo/server/metadata/RefreshesImpl.java
Show resolved
Hide resolved
server/base/src/main/java/org/apache/accumulo/server/metadata/RefreshesImpl.java
Show resolved
Hide resolved
server/base/src/main/java/org/apache/accumulo/server/metadata/RefreshesImpl.java
Show resolved
Hide resolved
server/base/src/main/java/org/apache/accumulo/server/metadata/RefreshesImpl.java
Show resolved
Hide resolved
server/base/src/main/java/org/apache/accumulo/server/metadata/RefreshesImpl.java
Show resolved
Hide resolved
.../src/main/java/org/apache/accumulo/manager/compaction/coordinator/CompactionCoordinator.java
Outdated
Show resolved
Hide resolved
core/src/main/java/org/apache/accumulo/core/metadata/RootTable.java
Outdated
Show resolved
Hide resolved
test/src/main/java/org/apache/accumulo/test/functional/CompactionIT.java
Outdated
Show resolved
Hide resolved
…ionIT.java Co-authored-by: Dave Marion <dlmarion@apache.org>
This commit modifies the compaction coordinator to reliably refresh hosted tablets in memory metadata after a compaction. The RPC request to a hosted tablet asking it to refresh happens after updating a tablets metadata for a compaction. The changes in the PR ensure that if the manager process dies after making the metadata update but before it makes the RPC that this will happen when the manager restarts.
The implementation for this relies on a new ~refresh sections in the metadata table. System compactions on hosted tablets will write a ~refresh entry before trying to update a tablets metadata. This entry allows the compaction commit process to be fault tolerant.
Javadoc was added to CompactionCoordinator.compactionCompleted() describing the overall process of committing a compaction.
This commit also refactored the refresh RPC code in bulk import so that it could also be used by compactions.
This commit also made the tablet metadata update for a compaction add scan entries for removed files when a tablet is hosted. This was done to prevent the Accumulo GC from removing compacted files that may be in use by an immediate scan.
fixes #3462