Skip to content

Commit

Permalink
Add additional logs for failure
Browse files Browse the repository at this point in the history
Signed-off-by: Rohit Nayak <[email protected]>
  • Loading branch information
rohit-nayak-ps committed Feb 8, 2025
1 parent 0ef27de commit e534e80
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions go/vt/vttablet/tabletmanager/vreplication/replicator_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
"vitess.io/vitess/go/sqlescape"
"vitess.io/vitess/go/sqltypes"
"vitess.io/vitess/go/vt/binlog/binlogplayer"
"vitess.io/vitess/go/vt/log"
"vitess.io/vitess/go/vt/sqlparser"
"vitess.io/vitess/go/vt/vterrors"
"vitess.io/vitess/go/vt/vtgate/evalengine"
Expand Down Expand Up @@ -725,8 +726,17 @@ func (tp *TablePlan) appendFromRow(buf *bytes2.Buffer, row *querypb.Row) error {
len(tp.Fields), len(bindLocations))
}
if len(row.Lengths) < len(tp.Fields) {
return vterrors.Errorf(vtrpcpb.Code_INTERNAL, "wrong number of lengths: got %d lengths for %d fields",
len(row.Lengths), len(tp.Fields))
// temporary logs added for debugging a production issue for which we have not yet found root cause.
log.Warningf("appendFromRow: wrong number of lengths for table %s: got %d lengths for %d fields",
tp.TablePlanBuilder.name, len(row.Lengths), len(tp.Fields))
for i, fld := range tp.Fields {
log.Warningf("appendFromRow: field:: %d:%s/%s", i, fld.Table, fld.Name)
}
for i, length := range row.Lengths {
log.Warningf("appendFromRow: col length:: %d:%d", i, length)
}
return vterrors.Errorf(vtrpcpb.Code_INTERNAL, "wrong number of lengths for table %s: got %d lengths for %d fields",
tp.TablePlanBuilder.name, len(row.Lengths), len(tp.Fields))
}

// Bind field values to locations.
Expand Down

0 comments on commit e534e80

Please sign in to comment.