endpoint: environment variable for disabling cleanup of stale step holds on HintMostRecentCommonAncestor

This commit is contained in:
Christian Schwarz 2020-03-30 11:36:20 +02:00
parent 4ecbb32044
commit 8c27e57edf

View File

@ -149,13 +149,19 @@ func (p *Sender) HintMostRecentCommonAncestor(ctx context.Context, r *pdu.HintMo
}
// cleanup previous steps
if !hintMostRecentCommonAncestorDoNotCleanupStepHolds {
if err := ReleaseStepCummulativeInclusive(ctx, fs, mostRecentVersion, p.jobId); err != nil {
return nil, errors.Wrap(err, "cannot cleanup prior invocation's step holds and bookmarks")
}
} else {
log.Info("skipping cleanup of prior invocations' step holds due to environment variable setting")
}
return &pdu.HintMostRecentCommonAncestorRes{}, nil
}
var hintMostRecentCommonAncestorDoNotCleanupStepHolds = envconst.Bool("ZREPL_ENDPOINT_HINT_MOST_RECENT_DO_NOT_CLEANUP_STEPH_HOLDS", false)
var maxConcurrentZFSSendSemaphore = semaphore.New(envconst.Int64("ZREPL_ENDPOINT_MAX_CONCURRENT_SEND", 10))
func uncheckedSendArgsFromPDU(fsv *pdu.FilesystemVersion) *zfs.ZFSSendArgVersion {