fix: error handling for index removal from selected field (#1935)

Co-authored-by: Ankit Nayan <ankit@signoz.io>
This commit is contained in:
Nityananda Gohain 2022-12-28 14:31:57 +05:30 committed by GitHub
parent 1916fc87b0
commit 2e58f6db7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3233,7 +3233,8 @@ func (r *ClickHouseReader) UpdateLogField(ctx context.Context, field *model.Upda
// remove index
query := fmt.Sprintf("ALTER TABLE %s.%s ON CLUSTER %s DROP INDEX IF EXISTS %s_idx", r.logsDB, r.logsLocalTable, cluster, field.Name)
err := r.db.Exec(ctx, query)
if err != nil {
// we are ignoring errors with code 341 as it is an error with updating old part https://github.com/SigNoz/engineering-pod/issues/919#issuecomment-1366344346
if err != nil && !strings.HasPrefix(err.Error(), "code: 341") {
return &model.ApiError{Err: err, Typ: model.ErrorInternal}
}
}