improve logging and fail unified-storage migration with more than 0 errors (#108471)
improve logging and fail unified-storage migration with more than 0 errors
This commit is contained in:
@@ -310,6 +310,7 @@ func (a *dashboardSqlAccess) migrateDashboards(ctx context.Context, orgId int64,
|
||||
"dashboard", row.Dash.Name,
|
||||
"uid", row.Dash.UID,
|
||||
"id", id,
|
||||
"namespace", opts.Namespace,
|
||||
)
|
||||
opts.Progress(-2, fmt.Sprintf("rejected: id:%s, uid:%s", id, row.Dash.Name))
|
||||
}
|
||||
|
||||
@@ -175,7 +175,8 @@ func (r *rowsWrapper) Next() bool {
|
||||
|
||||
r.row, err = r.a.scanRow(r.rows, r.history)
|
||||
if err != nil {
|
||||
if len(r.rejected) > 1000 || r.row == nil {
|
||||
r.a.log.Error("error scanning dashboard", "error", err)
|
||||
if len(r.rejected) > 0 || r.row == nil {
|
||||
r.err = fmt.Errorf("too many rejected rows (%d) %w", len(r.rejected), err)
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user