-
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
Modify error message strings. #2164
Conversation
@@ -869,7 +869,7 @@ func exportDataOffline(ctx context.Context, cancel context.CancelFunc, finalTabl | |||
cancel() //will cancel/stop both dump tool and progress bar | |||
time.Sleep(time.Second * 5) //give sometime for the cancel to complete before this function returns | |||
utils.ErrExit("yb-voyager encountered internal error. "+ | |||
"Check %s/logs/yb-voyager-export-data.log for more details.", exportDir) | |||
"Check: %s/logs/yb-voyager-export-data.log for more details.", exportDir) |
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.
nit: utils.ErrExit("yb-voyager encountered internal error: "+
"Check %s/logs/yb-voyager-export-data.log for more details.", exportDir)
yb-voyager/cmd/importData.go
Outdated
@@ -419,7 +419,7 @@ func applyTableListFilter(importFileTasks []*ImportFileTask) []*ImportFileTask { | |||
} | |||
} | |||
if len(unqualifiedTables) > 0 { | |||
utils.ErrExit("Qualify following table names %v in the %s list with schema-name.", unqualifiedTables, listName) | |||
utils.ErrExit("Qualify following table names: %v in the %s list with schema-name.", unqualifiedTables, listName) |
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.
utils.ErrExit("Qualify following table names in the %s list with schema-name: %v", listName, unqualifiedTables)
listName is string include / exclude
.
yb-voyager/cmd/importData.go
Outdated
@@ -1104,14 +1104,14 @@ func splitFilesForTable(state *ImportDataState, filePath string, t sqlname.NameT | |||
if tconf.TargetDBType == YUGABYTEDB { | |||
ybSpecificMsg = ", but should be strictly lower than the the rpc_max_message_size on YugabyteDB (default 267386880 bytes)" | |||
} | |||
utils.ErrExit("record num=%d for table %q in file %s is larger than the max batch size %d bytes Max Batch size can be changed using env var MAX_BATCH_SIZE_BYTES%s", numLinesTaken, t.ForOutput(), filePath, tdb.MaxBatchSizeInBytes(), ybSpecificMsg) | |||
utils.ErrExit("record larger than max batch size: record num=%d for table %q in file %s is larger than the max batch size %d bytes Max Batch size can be changed using env var MAX_BATCH_SIZE_BYTES%s", numLinesTaken, t.ForOutput(), filePath, tdb.MaxBatchSizeInBytes(), ybSpecificMsg) |
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.
should we also add currentBytesRead in error msg -
utils.ErrExit("record of size %d larger than max batch size: record num=%d for table %q in file %s is larger than the max batch size %d bytes Max Batch size can be changed using env var MAX_BATCH_SIZE_BYTES%s", currentBytesRead, numLinesTaken, t.ForOutput(), filePath, tdb.MaxBatchSizeInBytes(), ybSpecificMsg)
yb-voyager/src/srcdb/mysql.go
Outdated
@@ -94,7 +94,7 @@ func (ms *MySQL) GetTableApproxRowCount(tableName sqlname.NameTuple) int64 { | |||
log.Infof("Querying '%s' approx row count of table %q", query, tableName.String()) | |||
err := ms.db.QueryRow(query).Scan(&approxRowCount) | |||
if err != nil { | |||
utils.ErrExit("Failed to query %q for approx row count of %q: %s", query, tableName.String(), err) | |||
utils.ErrExit("Failed to query for approx row count of %q: %q %s", tableName.String(), query, 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.
utils.ErrExit("Failed to query for approx row count: %q: %q %s", tableName.String(), query, err)
yb-voyager/src/srcdb/postgres.go
Outdated
@@ -160,7 +160,7 @@ func (pg *PostgreSQL) GetTableApproxRowCount(tableName sqlname.NameTuple) int64 | |||
log.Infof("Querying '%s' approx row count of table %q", query, tableName.String()) | |||
err := pg.db.QueryRow(query).Scan(&approxRowCount) | |||
if err != nil { | |||
utils.ErrExit("Failed to query %q for approx row count of %q: %s", query, tableName.String(), err) | |||
utils.ErrExit("Failed to query for approx row count of %q: %q: %s", tableName.String(), query, 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.
utils.ErrExit("Failed to query for approx row count: %q: %q: %s", tableName.String(), query, 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.
LGTM!
Describe the changes in this pull request
Modify error strings to include user-specific details only after a ":". This is because as part of sending error messages to callhome, we sanitize them by picking the segment of the error message before the first ":"
Describe if there are any user-facing changes
How was this pull request tested?
Does your PR have changes that can cause upgrade issues?