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:
Will Assis
2025-07-22 13:44:04 +00:00
committed by GitHub
parent 85a1a35948
commit 71cb623cb7
2 changed files with 3 additions and 1 deletions
@@ -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
}