func (p *BackupPolicy) WithMaxRetryTimes(retryTimes int) {
	if retryTimes < 0 || retryTimes > maxBackupRetryTimes {
		panic(fmt.Errorf("maxBackupRetryTimes is %d", maxBackupRetryTimes))
	}
	p.StopPolicy.MaxRetryTimes = retryTimes
}
WithMaxRetryTimes default is 1, not include first call
package retry
import (
	"fmt"
)
const maxBackupRetryTimes = 2
func NewBackupPolicy(delayMS uint32) *BackupPolicy {
	if delayMS == 0 {
		panic("invalid backup request delay duration")
	}
	p := &BackupPolicy{
		RetryDelayMS: delayMS,
		StopPolicy: StopPolicy{
			MaxRetryTimes:    1,
			DisableChainStop: false,
			CBPolicy: CBPolicy{
				ErrorRate: defaultCBErrRate,
			},
		},
	}
	return p
}