Skip to content

Conversation

@guillaumemichel
Copy link
Collaborator

Recent conflict resolution (probably in #1193) removed some code.

This PR restores the removed code. Hopefully it doesn't miss anything.

I had already resolved some conflicts between the recent PRs in branch recent-changes-tmp used in https://github.com/ipshipyard/waterworks-infra/pull/821, but it didn't include #1194 at the time.

I used the command git diff a53fc23f77f4e2ec87ce733b8efaabce38ecf8f9 1acbd9b to identify removed code, and filtering out connectivity related changes (introduced in #1194).

github.com/ipfs/go-cid v0.5.0
github.com/ipfs/go-datastore v0.9.0
github.com/ipfs/go-detect-race v0.0.1
github.com/ipfs/go-ds-pebble v0.5.6
Copy link
Member

@lidel lidel Nov 7, 2025

Choose a reason for hiding this comment

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

nit: this pulls in extra deps, and we already had leveldb in dependency tree, but i think we need to use pebble because leveldb is not compatible with testing/synctest (?)

either way, merging, we can cleanup before tagging final release (waiting with that until after kubo 0.39.0-rc1 (we will do kad-dht release only before final kubo 0.39)

I will switch to latest kubo master and test in ipfs/kubo#10955

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We can try using leveldb and if it works fine, no need to pull pebble. The goal of the test is to persist state on disk (not only MapDatastore), and restore that state from disk.

// This is a corner case that is required for Kubo, as Keystore.Reset()
// takes a while.
s.reprovideQueue.Enqueue(keyspace.AllKeys(s.schedule, s.order)...)
s.catchupPendingWork()
Copy link
Member

@lidel lidel Nov 7, 2025

Choose a reason for hiding this comment

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

(note to self why we need it)

Without catchupPendingWork():

  1. Kubo calls Keystore.Reset() with new CIDs (could be a slow operation)
  2. RefreshSchedule() enqueues ALL regions to reprovideQueue
  3. Work sits idle in the queue waiting for the next periodic retry (could be minutes away)
  4. New content is not announced to the DHT for an extended period
  5. The content is effectively invisible to the network during this window

With catchupPendingWork():

  1. Kubo calls Keystore.Reset() with new CIDs
  2. RefreshSchedule() enqueues ALL regions to reprovideQueue
  3. Immediately spawns goroutine to process the queue
  4. New content is announced to DHT as soon as possible
  5. Content becomes discoverable immediately

@lidel lidel merged commit 58b46ba into master Nov 7, 2025
9 checks passed
lidel added a commit to ipfs/kubo that referenced this pull request Nov 7, 2025
gammazero pushed a commit that referenced this pull request Nov 12, 2025
gammazero pushed a commit that referenced this pull request Nov 12, 2025
* fix(provider): protect `SweepingProvider.wg`
* fix(provider): conflict resolution (#1199)
* fix(ResettableKeystore): race when closing during reset (#1201)
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

Successfully merging this pull request may close these issues.

3 participants