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>
32 lines
1,004 B
Go
32 lines
1,004 B
Go
package objectconfig_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/TrueCloudLab/frostfs-node/cmd/frostfs-node/config"
|
|
objectconfig "github.com/TrueCloudLab/frostfs-node/cmd/frostfs-node/config/object"
|
|
configtest "github.com/TrueCloudLab/frostfs-node/cmd/frostfs-node/config/test"
|
|
"github.com/stretchr/testify/require"
|
|
)
|
|
|
|
func TestObjectSection(t *testing.T) {
|
|
t.Run("defaults", func(t *testing.T) {
|
|
empty := configtest.EmptyConfig()
|
|
|
|
require.Equal(t, objectconfig.PutPoolSizeDefault, objectconfig.Put(empty).PoolSizeRemote())
|
|
require.EqualValues(t, objectconfig.DefaultTombstoneLifetime, objectconfig.TombstoneLifetime(empty))
|
|
})
|
|
|
|
const path = "../../../../config/example/node"
|
|
|
|
var fileConfigTest = func(c *config.Config) {
|
|
require.Equal(t, 100, objectconfig.Put(c).PoolSizeRemote())
|
|
require.EqualValues(t, 10, objectconfig.TombstoneLifetime(c))
|
|
}
|
|
|
|
configtest.ForEachFileType(path, fileConfigTest)
|
|
|
|
t.Run("ENV", func(t *testing.T) {
|
|
configtest.ForEnvFileType(path, fileConfigTest)
|
|
})
|
|
}
|