Q: Is it possible to update existing Namespace properties like Retention period?
A: yes, use update namespace API
Q: Is it possible to delete Namespace
A: this feature is not supported
Q: What is min and max retention period is allowed
A: min 1 day, max 30 days
Wenquan,
Has the max retention period been changed? We used to put 90 days but for a new namespace, perhaps after an upgrade, it’s not letting me.
Also, can you please improve this error message? “A valid retention period is not set on request.” should tell us what the constraints are.
Thank you.
the max 30 days retention is always there
const (
// MinLongPollTimeout is the minimum context timeout for long poll API, below which
// the request won't be processed
MinLongPollTimeout = time.Second * 2
// CriticalLongPollTimeout is a threshold for the context timeout passed into long poll API,
// below which a warning will be logged
CriticalLongPollTimeout = time.Second * 20
// MaxWorkflowRetentionPeriod is the maximum of workflow retention when registering namespace
// !!! Do NOT simply decrease this number, because it is being used by history scavenger to avoid race condition against history archival.
// Check more details in history scanner(scavenger)
MaxWorkflowRetentionPeriod = 30 * time.Hour * 24
)
const (
// DefaultWorkflowExecutionTimeout is the Default Workflow Execution timeout applied to a Workflow when
// this value is not explicitly set by the user on a Start Workflow request
// Intention is 10 years
DefaultWorkflowExecutionTimeout = 24 * 365 * 10 * time.Hour
// DefaultWorkflowRunTimeout is the Default Workflow Run timeout applied to a Workflow when
// this value is not explicitly set by the user on a Start Workflow request
}
if err := wh.versionChecker.ClientSupported(ctx, wh.config.EnableClientVersionCheck()); err != nil {
return nil, wh.error(err, scope)
}
if request == nil {
return nil, errRequestNotSet
}
if timestamp.DurationValue(request.GetWorkflowExecutionRetentionPeriod()) > common.MaxWorkflowRetentionPeriod {
return nil, errInvalidRetention
}
if err := wh.checkPermission(wh.config, request.SecurityToken); err != nil {
return nil, err
}
if request.GetName() == "" {
return nil, errNamespaceNotSet
}
there was however a bug in update namespace API which omits the retention check, which is fixed here: Add missing retention days check on update namespace API by wxing1292 · Pull Request #1407 · temporalio/temporal · GitHub