-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
Encapsulate Translog in Engine #31220
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
I think this all looks ok but I wonder if we should remove the
Translog
part from all these methods. They would read my cleaner to me and it would suddenly be an implementation detail for the engine if it's a translog.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.
So that would mean:
isTranslogSyncNeeded
->isSyncNeeded
syncTranslog
->sync
ensureTranslogSynced
->ensureSynced
acquireTranslogRetentionLock
->acquireRetentionLock
newTranslogSnapshotFromMinSeqNo
->newSnapshotFromMinSeqNo
estimateTranslogOperationsFromMinSeq
->estimateOperationsFromMinSeq
getTranslogStats
->getStats
getTranslogLastWriteLocation
->getLastWriteLocation
So, I don't think this would be necessarily bad, but I do think it's not trivial, for example, we'd then have
sync
andflush
, which to me is strange to have both (as an external person, is "sync" for synchronizing everything with Lucene?), we would also wantgetStats
to return generic statistic information, not just from a translog? DoesgetLastWriteLocation
return writes from Lucene or the Translog now?I think maybe reorganizing
Engine
to be as small as possible is good, I think we might need better terminology than dropping "translog" from the names though, especially since we still returnTranslog.Snapshot
andTranslog.Location
if we want to completely hide the translog. Right now even if we rename it's still not an implementation detail, because the classes are still Translog-specific.For now I'll merge this and open a seperate issue to make Translog completely an implementation detail of the Engine.
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.
I think the
translog
is needed for now, the translog is not an implementation detail, it's a fundamental component of the system that other components go through the engine to interact with. A lot of these methods would not make sense if they didn't refer to the fact that they are doing something to the translog.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.
+1 to what Lee and Jason said. It's a good idea but I don't think we're ready yet. @dakrone do you mind adding your renaming list to the #31248 so it clarifies the issue?
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.
Sure, I added the list