Globally Unique FATE Transaction Ids - Part 4#4258
Merged
keith-turner merged 7 commits intoFeb 16, 2024
Merged
Conversation
This addresses several previously deferred changes for issue apache#4044. Changes: - ZooReservation now uses FateId (used in Utils) - TabletOperationId now uses FateId - TExternalCompactionJob now uses FateId - VolumeManager and VolumeManagerImpl now use FateId - Utils.getLock() lockData now uses the full FateId - TabletRefresher now uses FateId - Classes which used the above classes updated - Several test changes to reflect new changes - Deferred a couple of changes (in Compactor and CompactionCoordinator) (need pull/4247 merged first)
Member
Author
|
Working on build failure fix |
…d on PR 4247 being merged first
This was referenced Feb 16, 2024
| while (true) { | ||
| try { | ||
| zk.putPersistentData(path, (reservationID + ":" + debugInfo).getBytes(UTF_8), | ||
| zk.putPersistentData(path, (fateId + DELIMITER + debugInfo).getBytes(UTF_8), |
Contributor
There was a problem hiding this comment.
When using fate ids in persisted data, its a bit safer to call the canonical() method vs toString() because its more well defined what the intention is.
Suggested change
| zk.putPersistentData(path, (fateId + DELIMITER + debugInfo).getBytes(UTF_8), | |
| zk.putPersistentData(path, (fateId.canonical() + DELIMITER + debugInfo).getBytes(UTF_8), |
| public static String validate(String opid) { | ||
| var fields = opid.split(":"); | ||
| Preconditions.checkArgument(fields.length == 2, "Malformed operation id %s", opid); | ||
| Preconditions.checkArgument(fields.length == 4, "Malformed operation id %s", opid); |
Contributor
There was a problem hiding this comment.
Could use the following String method then, can leave the rest of the code as is (like check for 2 and assume the field[1] is the entire fate id even if it has ":")
var fields = opid.split(":",2);| public TabletOperationType getType() { | ||
| var fields = canonical().split(":"); | ||
| Preconditions.checkState(fields.length == 2); | ||
| Preconditions.checkState(fields.length == 4); |
Contributor
There was a problem hiding this comment.
Could also use split(":",2) in this method.
keith-turner
approved these changes
Feb 16, 2024
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This addresses several previously deferred changes for issue #4044.
Changes: