lib/uplinkc: fix test flakiness by setting MaxTimeSkew
Not having a skew caused an issue where: 1. Uplink calls "begin segment", where segment isn't committed to the database. 2. Uplink stores piece X to the storage node A with timestamp 1. 3. Satellite runs garbage collection with timestamp 2. 4. Satellite sends retain request to storage node A with timestamp 2. 5. Storage node A deletes piece X, because 1 < 2. 6. Uplink calls "commit segment" with storage node A in it. 7. Download of segment fails, because A doesn't have piece X. In production this is not an issue since the MaxTimeSkew is 72h by default. Change-Id: Id87ca3ddc44103dcd85d031b1367168c014b8e7b
This commit is contained in:
parent
c4cbc6ff2f
commit
10d932fd65
@ -132,6 +132,7 @@ func (planet *Planet) newStorageNodes(count int, whitelistedSatellites storj.Nod
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Retain: retain.Config{
|
Retain: retain.Config{
|
||||||
|
MaxTimeSkew: 10 * time.Second,
|
||||||
Status: retain.Enabled,
|
Status: retain.Enabled,
|
||||||
Concurrency: 5,
|
Concurrency: 5,
|
||||||
},
|
},
|
||||||
|
@ -20,6 +20,7 @@ import (
|
|||||||
"storj.io/storj/private/testplanet"
|
"storj.io/storj/private/testplanet"
|
||||||
"storj.io/storj/satellite"
|
"storj.io/storj/satellite"
|
||||||
"storj.io/storj/storage"
|
"storj.io/storj/storage"
|
||||||
|
"storj.io/storj/storagenode"
|
||||||
)
|
)
|
||||||
|
|
||||||
// TestGarbageCollection does the following:
|
// TestGarbageCollection does the following:
|
||||||
@ -37,6 +38,9 @@ func TestGarbageCollection(t *testing.T) {
|
|||||||
config.GarbageCollection.FalsePositiveRate = 0.000000001
|
config.GarbageCollection.FalsePositiveRate = 0.000000001
|
||||||
config.GarbageCollection.Interval = 500 * time.Millisecond
|
config.GarbageCollection.Interval = 500 * time.Millisecond
|
||||||
},
|
},
|
||||||
|
StorageNode: func(index int, config *storagenode.Config) {
|
||||||
|
config.Retain.MaxTimeSkew = 0
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
|
}, func(t *testing.T, ctx *testcontext.Context, planet *testplanet.Planet) {
|
||||||
satellite := planet.Satellites[0]
|
satellite := planet.Satellites[0]
|
||||||
|
Loading…
Reference in New Issue
Block a user