Concurrency while publishing files with the same name #38
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
dependencies
Epic
good first issue
hacktoberfest
help wanted
icebox
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbry.go#38
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
consider the following videos:
the claim name is based on the title, a limit is enforced thus trimming out a part of the name.
claim name for the 5 videos as computed by the algorithm:
lbry.go attempts to publish all videos concurrently. The end result is ambiguous. If they are of similar size they will end up being published in the same block. some will be rejected, some will not. If a video goes through on block 100, the other 4 risk either failing and attempting the very subsequent
my-awesome-dog-and-its-friend-sp-1...
or updating the previous claim. If they go through in the same block, separate claims with the same claim_name are sent through (I believe).All in all it's a chaos.
A solution should ensure that no 2 videos can attempt publishing using the same name ever.
My idea: the video tracking table contains the claim names used, said claim names should be returned (and probably are already returned) together with the channel status response payload.
lbry.go needs to check against that list before attempting a publication, if a collision is detected, another name should be attempted.
If you search related to generating a unique slug with maximum length, you can find code samples with good patterns to solve this.
solved with
9424dce8ed
i didn't touch the name generation pattern as it was working already. However now I'm supplying the function with complete data about the previous claims, it was using a local version that would reset at every startup.