-
Notifications
You must be signed in to change notification settings - Fork 2
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
SKY-147 Scanner #7
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Conflicts: # api/handlers.go # database/skylink.go # test/database/skylink_test.go
Refactor a worker a bit to improve readability naming consistency (threaded should be run in a goroutine by itself). Don't pass the entire configuration struct to submodules, pass only the needed values.
MSevey
reviewed
May 4, 2022
MSevey
suggested changes
May 4, 2022
peterjan
requested changes
May 5, 2022
Use a random sia path when pinning a skylink.
peterjan
reviewed
May 6, 2022
MSevey
reviewed
May 6, 2022
MSevey
previously approved these changes
May 6, 2022
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 most things can be handled in follow ups to unblock this PR and allow for smaller PRs to handle the individual follow ups
Wait for the file to reach full redundancy before pinning the next one. Use the estimated time for reaching full redundancy to decide how long to wait.
peterjan
reviewed
May 9, 2022
peterjan
previously approved these changes
May 9, 2022
LGTM, I guess it's fine to do everything in a F/U at this point |
Randomize sleep between scans.
This was referenced May 9, 2022
MSevey
reviewed
May 9, 2022
MSevey
approved these changes
May 9, 2022
peterjan
approved these changes
May 10, 2022
ChrisSchinnerl
approved these changes
May 10, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PULL REQUEST
Overview
This PR introduces a background worker task that scans the DB for underpinned (meaning they don't have enough pinners) skylinks and pins them to the local skyd.
Other items:
maybe use a locking library: SKY-146 Unpin endpoint #2 (comment)-> Using the
mongo-lock
library here would be counter-productive because we can't easily find a single skylink record which matches our criteria and it's not locked. We can find all of them and iterate over the cursor, trying to lock one until we manage to do so but this is a much heavier call and it's just unnecessary. The current simple approach offindOneAndUpdate
which finds the first skylink that matches our criteria and sets its lock timestamp should be all that we need at this point. This operation should be atomic, so it shouldn't be able to silently fail with either a double-lock or no lock at all.skymodules.Skylink
: SKY-146 Unpin endpoint #2 (comment)Example for Visual Changes
Checklist
Review and complete the checklist to ensure that the PR is complete before assigned to an approver.
Issues Closed