Skip to content

Commit

Permalink
Add const to better explain initial len
Browse files Browse the repository at this point in the history
Signed-off-by: Matt Lord <[email protected]>
  • Loading branch information
mattlord committed Dec 5, 2024
1 parent ce3998e commit 26f93d4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/vt/vttablet/tabletmanager/vreplication/vdbclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ import (
"vitess.io/vitess/go/vt/vterrors"
)

const beginStmtLen = int64(len("begin;"))

// vdbClient is a wrapper on binlogplayer.DBClient.
// It allows us to retry a failed transactions on lock errors.
type vdbClient struct {
Expand Down Expand Up @@ -61,7 +63,7 @@ func (vc *vdbClient) Begin() error {
// starts with the BEGIN and ends with the COMMIT, so we
// do not send a BEGIN down the wire ahead of time.
vc.queriesPos = int64(len(vc.queries))
vc.batchSize = 6 // begin and semicolon
vc.batchSize = beginStmtLen
} else {
// We're not batching so we start the transaction here
// by sending the BEGIN down the wire.
Expand Down

0 comments on commit 26f93d4

Please sign in to comment.