-
Notifications
You must be signed in to change notification settings - Fork 387
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
satellite/audit: create the audit queue #2888
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few nits, but otherwise looks good.
internal/testplanet/satellite.go
Outdated
@@ -162,10 +162,14 @@ func (planet *Planet) newSatellites(count int) ([]*satellite.Peer, error) { | |||
MaxExcessRateOptimalThreshold: 0.05, | |||
}, | |||
Audit: audit.Config{ | |||
Slots: 3, | |||
ChoreInterval: 30 * time.Second, | |||
QueueInterval: 1 * time.Hour, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Let's keep the config organised the same way as the definition.
satellite/audit/queue_test.go
Outdated
testQueue2 := []storj.Path{"0", "1", "2"} | ||
q.Swap(testQueue2) | ||
|
||
path, err = q.Next() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can be written as:
for _, expected := range testQueue2 {
path, err := q.Next()
require.NoError(t, err)
require.EqualValues(t, expected, path)
}
satellite/audit/reservoirchore.go
Outdated
) | ||
|
||
// ReservoirChore populates reservoirs and the audit queue. | ||
type ReservoirChore struct { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If the other audit thing is going away, this could be named just Chore
, because there wouldn't be a naming conflict.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that's worth to wait for @mobyvb review
What:
Why:
reservoirChore.Run
adds reservoir paths to queue in pseudorandom orderPlease describe the tests:
TestChoreAndWorkerIntegration:
This test ensures that after uploading 2 files (1 remote segment each), the paths for those files appear appropriately in the queue.
TestQueue:
This tests the expected behavior of the Swap and Next methods of the queue struct.
Please describe the performance impact:
Code Review Checklist (to be filled out by reviewer)