Skip to content
This repository has been archived by the owner on Sep 21, 2024. It is now read-only.

fix: Recovery only uses latest version of sphere #703

Merged
merged 3 commits into from
Nov 1, 2023

Conversation

cdata
Copy link
Collaborator

@cdata cdata commented Oct 31, 2023

This change modifies the /v0alpha1/replicate route to accept a include_content parameter. The use-case of the parameter is to facilitate a recovery via replication.

Additionally, recovery has been changed to use /v0alpha1/replicate instead of /v0alpha1/fetch. We are doing this to head-off the scaling fault where a user cannot successfully recovery if their gateway's sphere has a really long history.

The most notable consequence of this change is that a user who recovers their sphere from a gateway will not have any of the "history" of changes prior to the recovery point available on the recovery device. We'll have to reckon with this choice at some point down the road when we move to support end-user views into history.

As of this change, v0alpha1/fetch and /v0alpha1/replicate are probably redundant (with fetch being a subset of replicate), but for now I think we should leave both in place and decide how to consolidate them in a future change.

Copy link
Contributor

github-actions bot commented Oct 31, 2023

Test flake analysis

status platform features toolchain
🟢 windows-latest test-kubo,headers stable
🟢 ubuntu-latest test-kubo,headers stable
🟢 macos-13 test-kubo,headers stable
🟡 ubuntu-latest test-kubo,headers,rocksdb stable
🟢 macos-13 test-kubo,headers,rocksdb stable

Flake summary for ubuntu-latest, test-kubo,headers,rocksdb, stable

     Summary [  65.246s] 175 tests run: 175 passed (1 flaky), 1 skipped
   FLAKY 2/6 [   1.896s] noosphere-ns dht::node::test::test_dhtnode_bootstrap

@cdata cdata force-pushed the fix/recovery-only-uses-latest-version branch from 9d9edb1 to 504a37e Compare November 1, 2023 00:22
@cdata cdata requested a review from jsantell November 1, 2023 00:25
@cdata cdata marked this pull request as ready for review November 1, 2023 00:25
@cdata
Copy link
Collaborator Author

cdata commented Nov 1, 2023

Haven't seen this one flake before:

FLAKY 2/6 [ 1.896s] noosphere-ns dht::node::test::test_dhtnode_bootstrap

@jsantell
Copy link
Contributor

jsantell commented Nov 1, 2023

Haven't seen this one flake before:

FLAKY 2/6 [ 1.896s] noosphere-ns dht::node::test::test_dhtnode_bootstrap

I've seen this in another test, didn't expect a panic looks like await_or_timeout() function panics after 700ms of not achieving its success state. These tests were always a bit racey, could be improved here

--- TRY 1 STDERR:        noosphere-ns dht::node::test::test_dhtnode_bootstrap ---
thread 'dht::node::test::test_dhtnode_bootstrap' panicked at rust/noosphere-ns/src/dht/node.rs:249:42:
timed out: waiting for 4 peers

Copy link
Contributor

@jsantell jsantell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great 👍

@cdata cdata merged commit 500bd69 into main Nov 1, 2023
@cdata cdata deleted the fix/recovery-only-uses-latest-version branch November 1, 2023 17:05
@github-actions github-actions bot mentioned this pull request Nov 1, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants