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

routing fixes/refactor #5007

Merged
merged 12 commits into from
Jun 3, 2018
Merged

routing fixes/refactor #5007

merged 12 commits into from
Jun 3, 2018

Conversation

Stebalien
Copy link
Member

@Stebalien Stebalien commented May 9, 2018

  • Cleans up namesys a bit (don't use a map for fields, avoid casting).
  • Update for routing system refactor (replace GetValues with a more flexible
    GetValue).
  • Don't expect the DHT to keep outdated IPNS records.

fixes #4749
fixes #4954

Note: I'm not entirely happy with this patch but it's good enough for now.
Eventually, I'd prefer to pass the IpnsPublisher to the Republisher as I'm not a
fan of having the Republisher dig through the IpnsPublisher's datastore entries.

However, this unblocks us.

Depends on:

//
// This method will not search the routing system for records published by other
// nodes.
func (p *IpnsPublisher) ListPublished(ctx context.Context) (map[peer.ID]*pb.IpnsEntry, error) {
Copy link
Member Author

Choose a reason for hiding this comment

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

Should probably have a test. This isn't actually used right now but I'd like to expose it via a command (and use it from the republisher).

//
// If `checkRouting` is true and we have no existing record, this method will
// check the routing system for any existing records.
func (p *IpnsPublisher) GetPublished(ctx context.Context, id peer.ID, checkRouting bool) (*pb.IpnsEntry, error) {
Copy link
Member Author

Choose a reason for hiding this comment

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

checkRouting... (bleh)

@Stebalien Stebalien force-pushed the feat/routing-refactor branch 3 times, most recently from 96ee5d7 to 2192077 Compare May 9, 2018 14:12
@@ -20,7 +20,7 @@ test_ipfs_get_flag() {
'

test_expect_success "ipfs get $flag output looks good" '
printf "%s\n\n" "Saving archive to $HASH$ext" >expected &&
Copy link
Member Author

Choose a reason for hiding this comment

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

This seems strictly better but is technically a breaking change. Any idea why this has changed?

}
seqno := rec.GetSequence() // returns 0 if rec is nil
if rec != nil && value != path.Path(rec.GetValue()) {
// Don't bother incriminating the sequence number unless the
Copy link
Contributor

Choose a reason for hiding this comment

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

incriminating? :)

Copy link
Member Author

Choose a reason for hiding this comment

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

aspell has a surprisingly small english dictionary...

Copy link
Contributor

Choose a reason for hiding this comment

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

I am the author of said dictionary. I assumed you meant "incrementing", that is not a word found in most dictionaries, for example https://www.merriam-webster.com/dictionary/incrementing return no results. Nevertheless it is a word I will consider adding. Let's continue this discussion in an issue at https://github.com/en-wl/wordlist/issues.

Copy link
Member Author

Choose a reason for hiding this comment

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

@kevina you are! Awesome! Will do.

@Stebalien Stebalien force-pushed the feat/routing-refactor branch 2 times, most recently from 262f464 to adedd02 Compare May 17, 2018 20:07
n.Floodsub,
validator,
)
n.Routing = rhelpers.Tiered{
Copy link
Member

Choose a reason for hiding this comment

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

👍

@kevina
Copy link
Contributor

kevina commented May 31, 2018

What is the status of this? Is it likely to go in mostly as is?

Just FYI: I have not looked at this closely but this looks like it might be making API changes to the routing code. Some additional changes may be required to support sym-links.

@Stebalien
Copy link
Member Author

What is the status of this? Is it likely to go in mostly as is?

That's my plan. I'm almost done with the migration but that's the only thing left.

Just FYI: I have not looked at this closely but this looks like it might be making API changes to the routing code. Some additional changes may be required to support sym-links.

Symlinks? This should only be touching namesys/routing code (not unixfs path resolution or anything that should handle symlinks). Am I missing something?

@kevina
Copy link
Contributor

kevina commented Jun 1, 2018

Symlinks? This should only be touching namesys/routing code (not unixfs path resolution or anything that should handle symlinks). Am I missing something?

The current routing API makes adding support for symlinks difficult, espacally the handling of ..

See #3508.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@Stebalien
Copy link
Member Author

Does this patch make something worse?

And:

* Update for DHT changes.
* Switch to the new record validation system.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
The current convention is to return the concrete type instead of an interface so
let's go with that and have one constructor.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
fixes #4749

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
Remove ~50 lines of code, some casting, and a superfluous map (when go starts
looking like python, something's wrong).

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@kevina
Copy link
Contributor

kevina commented Jun 1, 2018 via email

@whyrusleeping
Copy link
Member

there shouldnt be any shared code between routing and symlinks... You might be thinking of the path resolver.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
We've added a new file to the flatfs datastore.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@ghost ghost added the status/in-progress In progress label Jun 2, 2018
Copy link
Member

@whyrusleeping whyrusleeping left a comment

Choose a reason for hiding this comment

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

This is a pretty complicated change, but I think i've reviewed it thoroughly and don't see any issues. Let's get this shipped and let's forge ahead and make IPNS great again!

_, ipnskey := IpnsKeysForID(id)
value, err = p.routing.GetValue(ctx, ipnskey)
if err != nil {
// Not found or other network issue. Can't really do
Copy link
Member

Choose a reason for hiding this comment

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

dropping errors makes me nervous, would appreciate maybe a debug or info log of this

Copy link
Member Author

Choose a reason for hiding this comment

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

Fair enough.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressed.

License: MIT
Signed-off-by: Steven Allen <steven@stebalien.com>
@Stebalien Stebalien added RFM and removed status/in-progress In progress need/review Needs a review labels Jun 2, 2018
@Stebalien
Copy link
Member Author

Stebalien commented Jun 2, 2018

DO NOT MERGE UNTIL: ipfs/infra#408

(well, actually, it's not that big of an issue as go-ipfs refers to that dist path directly by hash; but still).

Done.

@whyrusleeping whyrusleeping merged commit c3e011b into master Jun 3, 2018
@whyrusleeping whyrusleeping deleted the feat/routing-refactor branch June 3, 2018 05:30
This was referenced Jun 3, 2018
hacdias pushed a commit to ipfs/boxo that referenced this pull request Jan 27, 2023
routing fixes/refactor

This commit was moved from ipfs/kubo@c3e011b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
4 participants