Currently, DELETE service sets tombstone expiration epoch to `current epoch + 5`. This works less than ideal in private networks where an epoch can be e.g. 10 minutes. In this case, after a node is unavailable for more than 1 hour, already deleted objects have a chance to reappear. After this commit tombstone lifetime can be configured. Signed-off-by: Evgenii Stratonikov <e.stratonikov@yadro.com>
19 lines
528 B
Go
19 lines
528 B
Go
package objectconfig
|
|
|
|
import "github.com/TrueCloudLab/frostfs-node/cmd/frostfs-node/config"
|
|
|
|
const (
|
|
deleteSubsection = "delete"
|
|
|
|
// DefaultTombstoneLifetime is the default value of tombstone lifetime in epochs.
|
|
DefaultTombstoneLifetime = 5
|
|
)
|
|
|
|
// TombstoneLifetime returns the value of `tombstone_lifetime` config parameter.
|
|
func TombstoneLifetime(c *config.Config) uint64 {
|
|
ts := config.UintSafe(c.Sub(subsection).Sub(deleteSubsection), "tombstone_lifetime")
|
|
if ts <= 0 {
|
|
return DefaultTombstoneLifetime
|
|
}
|
|
return ts
|
|
}
|