Skip to content

Commit ec6a085

Browse files
committed
sidecar: fix the bug of start index of serverid
1 parent 9d18845 commit ec6a085

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

sidecar/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ func (cfg *Config) buildExtraConfig(filePath string) (*ini.File, error) {
329329
log.Info("It has remote cluster server-id start offset +100")
330330
startIndex += mysqlServerIDOffsetInc
331331
}
332-
if len(arr) == 3 && arr[1] == "ro" {
332+
if len(arr) >= 3 && arr[len(arr)-2] == "ro" {
333333
log.Info("It is readonly pod, server-id start offset +100")
334334
startIndex += mysqlServerIDOffsetInc
335335
}

0 commit comments

Comments
 (0)