-
Notifications
You must be signed in to change notification settings - Fork 11
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
Fix: retrieving Migration UUID as early as possible in the commands #2162
base: main
Are you sure you want to change the base?
Changes from 3 commits
adf8574
99e04e0
e12e605
39f5117
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,8 +47,12 @@ var importSchemaCmd = &cobra.Command{ | |
if tconf.TargetDBType == "" { | ||
tconf.TargetDBType = YUGABYTEDB | ||
} | ||
err := retrieveMigrationUUID() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Might be slightly unrelated question, but at this point what if export-dir is empty and user runs import-schema? What happens then? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In case of empty dirs and these commands we already have other checks just before this that checks if export-dir is initiated. And we can't do much in those cases we will still get the 00000... uuid in callhome There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. got it, but i guess now we will get the error message, so that should be helpful. |
||
if err != nil { | ||
utils.ErrExit("failed to get migration UUID: %w", err) | ||
} | ||
sourceDBType = GetSourceDBTypeFromMSR() | ||
err := validateImportFlags(cmd, TARGET_DB_IMPORTER_ROLE) | ||
err = validateImportFlags(cmd, TARGET_DB_IMPORTER_ROLE) | ||
if err != nil { | ||
utils.ErrExit("Error: %s", err.Error()) | ||
} | ||
|
@@ -79,10 +83,6 @@ var flagRefreshMViews utils.BoolStr | |
var invalidTargetIndexesCache map[string]bool | ||
|
||
func importSchema() error { | ||
err := retrieveMigrationUUID() | ||
if err != nil { | ||
return fmt.Errorf("failed to get migration UUID: %w", err) | ||
} | ||
|
||
tconf.Schema = strings.ToLower(tconf.Schema) | ||
|
||
|
@@ -93,7 +93,7 @@ func importSchema() error { | |
// available always and this is just for initialisation of tdb and marking it nil again back. | ||
tconf.Schema = "public" | ||
tdb = tgtdb.NewTargetDB(&tconf) | ||
err = tdb.Init() | ||
err := tdb.Init() | ||
if err != nil { | ||
utils.ErrExit("Failed to initialize the target DB: %s", err) | ||
} | ||
|
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.
can we do this above
GetSourceDBTypeFromMSR
? that also ErrExits.