Skip to content

Commit

Permalink
Correct cache mgmt for schema changes and binlog_image=noblob
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <mattalord@gmail.com>
  • Loading branch information
mattlord committed Nov 9, 2024
1 parent ab65f0c commit c36e603
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion go/vt/vttablet/tabletmanager/vreplication/replicator_plan.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,8 @@ func (rp *ReplicatorPlan) buildExecutionPlan(fieldEvent *binlogdatapb.FieldEvent
return nil, vterrors.Wrapf(err, "failed to build replication plan for %s table", fieldEvent.TableName)
}
tplan.Fields = fieldEvent.Fields
// Reset the rowInfo cache now that the plan's fields have changed.
tplan.rowInfo = nil
return tplan, nil
}

Expand Down Expand Up @@ -232,10 +234,11 @@ type TablePlan struct {
CollationEnv *collations.Environment
WorkflowConfig *vttablet.VReplicationConfig

// rowInfo is used as a lazily initiated cache of column information associated
// rowInfo is used as a lazily initialized cache of column information associated
// with querypb.Row values for bulk inserts. The base information is calculated
// once based on the table plan and only the row specific values are updated for
// each row as the row is processed.
// NOTE: this needs to be set to nil anytime the TablePlan's Fields are changed.
rowInfo []*colInfo
}

Expand Down

0 comments on commit c36e603

Please sign in to comment.