Skip to content

provider: only reprovide skipped regions after keystore.Reset() #1191

@guillaumemichel

Description

@guillaumemichel

if reprovideAll {
// If the keystore is resettable, RefreshSchedule should be called after a
// Keystore.Reset(), to reflect recent changes on the schedule.
// If the schedule is not empty, and its size is about to double, it means
// that many new keys were added to the Keystore recently, and we want to
// reprovide all regions as soon as possible to make sure the provider
// records are available in the DHT.
// This is a corner case that is required for Kubo, as Keystore.Reset()
// takes a while.
for _, entry := range keyspace.AllEntries(s.schedule, s.order) {
s.reprovideQueue.Enqueue(entry.Key)
}
}

If using a ResettableKeystore, we should only reprovide the regions that were reprovided since the node started. The regions that have been reprovided in a previous run, but less than ReprovideInterval ago don't need to be reprovided.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions