-
Notifications
You must be signed in to change notification settings - Fork 454
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
Globally Unique FATE Transaction Ids - Part 4 #4258
Globally Unique FATE Transaction Ids - Part 4 #4258
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)
Working on build failure fix |
…d on PR 4247 being merged first
|
||
while (true) { | ||
try { | ||
zk.putPersistentData(path, (reservationID + ":" + debugInfo).getBytes(UTF_8), | ||
zk.putPersistentData(path, (fateId + DELIMITER + debugInfo).getBytes(UTF_8), |
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.
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.
zk.putPersistentData(path, (fateId + DELIMITER + debugInfo).getBytes(UTF_8), | |
zk.putPersistentData(path, (fateId.canonical() + DELIMITER + debugInfo).getBytes(UTF_8), |
@@ -33,14 +33,14 @@ public class TabletOperationId extends AbstractId<TabletOperationId> { | |||
|
|||
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); |
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.
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);
@@ -53,15 +53,15 @@ private TabletOperationId(String canonical) { | |||
|
|||
public TabletOperationType getType() { | |||
var fields = canonical().split(":"); | |||
Preconditions.checkState(fields.length == 2); | |||
Preconditions.checkState(fields.length == 4); |
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.
Could also use split(":",2)
in this method.
This addresses several previously deferred changes for issue #4044.
Changes: