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

Difficulties replicating with peers that are friends after doing a feed recovery #38

Closed
staltz opened this issue May 7, 2021 · 4 comments

Comments

@staltz
Copy link
Member

staltz commented May 7, 2021

This issue in manyverse explains it properly: https://gitlab.com/staltz/manyverse/-/issues/1333#note_569151491

Quoting the relevant part:

I suspect this could be due to an update to ssb-ebt. In older versions, we used a hacked fork of ssb-ebt: staltz@7537cb0 but recently we started using ssb-ebt proper, because it had some updates and fixes.

Potentially related issue: #33

@arj03
Copy link
Member

arj03 commented May 9, 2021

Strange. I have not seem EBT causing trouble like this in browser core. Browser core has been using EBT 8 for a while, but is driving the EBT a bit differently than ssb-ebt because it needs it only to kick in after partial replication has run for a feed. It would interesting to see if you can reproduce this to see if its the change in rpc:connect that is causing this. Then we can have a temporary solution that works until we rework of all these modules and can do proper testing (codename: move outside range of the bermuda triangle). Alternatively revert back to your fork for now.

@staltz
Copy link
Member Author

staltz commented May 10, 2021

Alternatively revert back to your fork for now.

This would be simple and I don't see much downsides to it since we're going to anyway soon rewrite ssb-replicate, ssb-ebt, ssb-friends from ground up.

@staltz
Copy link
Member Author

staltz commented Jun 12, 2021

I want to finish this issue once and for all, so I did some extensive testing. First I tried to reproduce this issue #38 and issue #33 using ssb-ebt Tape tests. Couldn't reproduce.

Then I tried to reproduce it between Patchwork and Manyverse in the same LAN, using the typical reproduction steps, i.e.:

  • Alice has posted content, and follows Bob (and Bob follows Alice too)
  • Alice loses her database so she'll do a full re-sync
  • Alice and Bob are connected to the same Wi-Fi
  • Alice doesn't know that she's friends with Bob, so under ssb-conn scheduler logic, she does not initiate connection with Bob
  • Bob knows Alice is his friend, so Bob initiates the connection
  • Thus Bob isClient=true, and for Alice isClient=false
  • Bob creates the duplex stream connection with Alice
  • It doesn't matter if Alice has config.replicate.legacy enabled or disabled, replication occurs successfully

If Bob is using Patchwork 3.16.2, then Alice does not get her content back. That version had EBT disabled. If Bob uses Patchwork 3.17.1 or higher, then Alice successfully gets her content. That version had EBT enabled.

I'm not sure what happens when Bob is not following Alice (but Alice follows Bob), because under ssb-conn scheduler logic, Bob would not initiate a connection with Alice. And neither would Alice (because she doesn't know she follows Bob). But I'm okay with that corner case, because it can be considered either a bug in ssb-conn scheduler or a user mistake (if you want your data back, make sure to trigger the connections). Anyway I don't think it's an issue with ssb-ebt.

Sorry for the thorough message, but I'd like to give a definitive end to this issue. I want to stop using my hacky fork ssb-ebt-fork-staltz in Manyverse, and if people still encounter this issue, we can check:

  • Whether they are using Patchwork 3.16.2 or older
  • Whether the two peers follow each other or not
  • Whether the user has tried to manually connect (in Manyverse's Connections tab) or not

And I don't believe there would be any other action necessary to take other than the 3 options mentioned above.

@staltz staltz closed this as completed Jun 12, 2021
@arj03
Copy link
Member

arj03 commented Jun 12, 2021

Great debugging :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants