Skip to content

Commit

Permalink
Improve rowstreamer error message
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Jan 10, 2025
1 parent afa6ffb commit 91ded28
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions go/vt/vttablet/tabletmanager/vdiff/workflow_differ.go
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,8 @@ func (wd *workflowDiffer) buildPlan(dbClient binlogplayer.DBClient, filter *binl
return err
}

// We get the PK columns from the source schema as well, as they can
// differ and determine the proper lastPK to use when saving progress.
// We get the PK columns from the source schema as well as they can differ
// and they determine the proper position to use when saving our progress.
if err := td.getSourcePKCols(); err != nil {
return err
}
Expand Down
3 changes: 2 additions & 1 deletion go/vt/vttablet/tabletserver/vstreamer/rowstreamer.go
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,8 @@ func (rs *rowStreamer) buildSelect(st *binlogdatapb.MinimalTable) (string, error
buf.Myprintf(" from %v%s", sqlparser.NewIdentifierCS(rs.plan.Table.Name), indexHint)
if len(rs.lastpk) != 0 {
if len(rs.lastpk) != len(rs.pkColumns) {
return "", fmt.Errorf("primary key values don't match length: %v vs %v", rs.lastpk, rs.pkColumns)
return "", fmt.Errorf("cannot build a row streamer plan for the %s table as a lastpk value was provided and the number of primary key values within it (%v) does not match the number of primary key columns in the table (%d)",
st.Name, rs.lastpk, rs.pkColumns)
}
buf.WriteString(" where ")
prefix := ""
Expand Down

0 comments on commit 91ded28

Please sign in to comment.