satellite/repair/checker: persist placement information to the queue

Change-Id: I51c7fd5a2a38f9f6620c16eddaed3b4915ffd792
This commit is contained in:
Márton Elek 2023-09-18 13:59:12 +02:00 committed by Storj Robot
parent 18d5caad7e
commit b4fdc49194
2 changed files with 4 additions and 1 deletions

View File

@ -405,6 +405,7 @@ func (fork *observerFork) process(ctx context.Context, segment *rangedloop.Segme
Position: segment.Position,
UpdatedAt: time.Now().UTC(),
SegmentHealth: segmentHealth,
Placement: segment.Placement,
}, func() {
// Counters are increased after the queue has determined
// that the segment wasn't already queued for repair.

View File

@ -607,7 +607,7 @@ func TestObserver_PlacementCheck(t *testing.T) {
_, err := planet.Satellites[0].API.Buckets.Service.UpdateBucket(ctx, buckets.Bucket{
ProjectID: planet.Uplinks[0].Projects[0].ID,
Name: "testbucket",
Placement: storj.EU,
Placement: storj.PlacementConstraint(1),
})
require.NoError(t, err)
@ -672,6 +672,8 @@ func TestObserver_PlacementCheck(t *testing.T) {
require.NoError(t, err)
require.Equal(t, segments[0].StreamID, injuredSegment.StreamID)
require.Equal(t, segments[0].Placement, injuredSegment.Placement)
require.Equal(t, storj.PlacementConstraint(1), injuredSegment.Placement)
count, err := repairQueue.Count(ctx)
require.Zero(t, err)