From 5dfc757f1172efab2b79bfd2edccdc73ff42541f Mon Sep 17 00:00:00 2001 From: Mingjian Liu Date: Thu, 5 Mar 2020 14:56:59 -0800 Subject: [PATCH] Add more log when Insertion failed on Map Signed-off-by: Mingjian Liu --- go/vt/vtgate/engine/insert.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/go/vt/vtgate/engine/insert.go b/go/vt/vtgate/engine/insert.go index ec2a54f106e..a15c2c0e668 100644 --- a/go/vt/vtgate/engine/insert.go +++ b/go/vt/vtgate/engine/insert.go @@ -588,16 +588,22 @@ func (ins *Insert) processUnowned(vcursor VCursor, vindexColumnsKeys [][]sqltype if err != nil { return err } + + var mismatchVindexKeys [][]sqltypes.Value for i, v := range verified { + rowNum := verifyIndexes[i] if !v { if ins.Opcode != InsertShardedIgnore { - return fmt.Errorf("values %v for column %v does not map to keyspace ids", vindexColumnsKeys, colVindex.Columns) + mismatchVindexKeys = append(mismatchVindexKeys, vindexColumnsKeys[rowNum]) + continue } // InsertShardedIgnore: skip the row. ksids[verifyIndexes[i]] = nil - continue } } + if len(mismatchVindexKeys) > 0 { + return fmt.Errorf("values %v for column %v does not map to keyspace ids", mismatchVindexKeys, colVindex.Columns) + } } return nil }