Skip to content
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

Merged

Conversation

kevinrr888
Copy link
Member

@kevinrr888 kevinrr888 commented Feb 12, 2024

This addresses several previously deferred changes for issue #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) (edit - resolved these deferred changes)

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)
@kevinrr888
Copy link
Member Author

kevinrr888 commented Feb 13, 2024

Working on build failure fix
Edit: Fixed


while (true) {
try {
zk.putPersistentData(path, (reservationID + ":" + debugInfo).getBytes(UTF_8),
zk.putPersistentData(path, (fateId + DELIMITER + debugInfo).getBytes(UTF_8),
Copy link
Contributor

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.

Suggested change
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);
Copy link
Contributor

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);
Copy link
Contributor

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.

@keith-turner keith-turner merged commit a3ec20e into apache:elasticity Feb 16, 2024
8 checks passed
@DomGarguilo DomGarguilo added this to the 4.0.0 milestone Jul 12, 2024
@kevinrr888 kevinrr888 deleted the elasticity-feature-4044-deferrals-2 branch November 1, 2024 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants