You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
kayrus
changed the title
[BUG] Random prefix for snapshots/backups name are not random
[BUG] Random prefix for snapshot/backup names is not random
Jul 5, 2023
kayrus
changed the title
[BUG] Random prefix for snapshot/backup names is not random
[BUG] Random suffix for snapshot/backup names is not random
Jul 5, 2023
Describe the bug
Golang prior to 1.20 has a fixed seed for
math/rand.globalRand
and backup/snapshots have the same suffix in a name.Try to run https://go.dev/play/p/qKmDuwawK4H?v=goprev (go 1.19) several times and every time it will:
Comparing to https://go.dev/play/p/qKmDuwawK4H (go 1.20)
Steps to reproduce the behavior
Restore a snapshot and restart the velero. Then restore a new snapshot, the resulting snapshot names will have the same suffix:
2d9835a7-65e1-4728-97a0-9010a0e2a418.backup.5577006791947779410
2d9835a7-65e1-4728-97a0-9010a0e2a418.backup.5577006791947779410
Expected behavior
Velero plugin must generate unpredictable suffixes for volume/snapshot names.
This can be done by upgrading the go version to 1.20, or using the private rand object with its own seed based on timestamp.
See also golang/go#54880
The text was updated successfully, but these errors were encountered: