app/vminsert: properly replicate data for the last RF-1 storage nodes for -replicationFactor=RF

Previously the data for the last `RF-1` storage noes has been incorrectly replicated to the first storage node.
This commit is contained in:
Aliaksandr Valialkin 2020-06-19 12:39:19 +03:00
parent ca4c9023e3
commit 4400700832

View file

@ -164,7 +164,7 @@ func sendBufToReplicas(br *bufRows, snIdx, replicas int) bool {
return true
}
if idx >= len(storageNodes) {
idx = 0
idx %= len(storageNodes)
}
sn := storageNodes[idx]
idx++