Skip to content
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

Channel regeneration leaves old entries intact on update #6680

Closed
ichorid opened this issue Dec 24, 2021 · 0 comments · Fixed by #7726
Closed

Channel regeneration leaves old entries intact on update #6680

ichorid opened this issue Dec 24, 2021 · 0 comments · Fixed by #7726

Comments

@ichorid
Copy link
Contributor

ichorid commented Dec 24, 2021

Channels system supports regenerating one's personal channel in case of e.g. Tribler folder loss or channel torrent corruption. To do so, every ChannelMetadata entry includes the start_timestamp which sets the lower bound of timestamps during the processing of .mdblobs in the channel torrent dir.
However, there is no procedure for removing entries with timestamps lower than start_timestamp. As the result, there could be a situation when, for example:

  1. the author adds torrent A into their channel. start_timestamp is 100, timestamp is 102.
  2. the user downloads the channel and adds torrents A into their DB.
  3. the author loses their channel folder and re-creates their channel by adding torrents B into it. This time, start_timestamp is 200, timestamp is 202
  4. the user downloads the new version of the channel and adds B to their DB. Thus, the user will have both A and B in their local DB, which is incorrect, because the author's new version contains only B.

This problem is the most probable cause of #6395

To fix it, we should add a procedure to remove all the obsolete content from the channel on update. Unfortunately, the procedure will be very data-intensive for big channels, since we'll have to limit the removal by the top-level channel id, resolving an entry's parents recursively. Otherwise, we could accidentally remove entries from another channel by the same user.

@ichorid ichorid added this to the 7.12.0 January milestone Dec 24, 2021
@ichorid ichorid self-assigned this Dec 24, 2021
@drew2a drew2a modified the milestones: 7.12.0, 7.13.0 Oct 14, 2022
@drew2a drew2a removed this from the 7.13.0 milestone Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging a pull request may close this issue.

2 participants