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

Where are the indexes actually being set? #306

Open
KyleMaas opened this issue Jan 23, 2023 · 5 comments
Open

Where are the indexes actually being set? #306

KyleMaas opened this issue Jan 23, 2023 · 5 comments
Labels
question Further information is requested

Comments

@KyleMaas
Copy link
Contributor

From what I can tell from reading through the Margaret code, there should be some kind of a processing/setter function which is called by Margaret for each message on each index which either sets a Margaret index value or doesn't, depending on whether the message matches what's needed for that index. Where are these filter/set functions?

@KyleMaas
Copy link
Contributor Author

The only places I'm seeing indexes actually having a Set() called on them is within plugins, and none of them look like they set any values that would be queried by, for example, the ByType index or the Users index.

@KyleMaas
Copy link
Contributor Author

I think most (but still not all) of this is being handled here:

https://github.com/ssbc/go-ssb/blob/master/multilogs/combined.go

@decentral1se decentral1se added the question Further information is requested label Jan 28, 2023
@boreq
Copy link
Contributor

boreq commented Feb 3, 2023

I think most (but still not all) of this is being handled here:

https://github.com/ssbc/go-ssb/blob/master/multilogs/combined.go

That is just the combined index which isn't really used that much. The actual updates to other indexes happen for example here:

func (b *BadgerBuilder) updateContacts(ctx context.Context, seq int64, val interface{}, idx librarian.SetterIndex) error {

@KyleMaas
Copy link
Contributor Author

KyleMaas commented Feb 3, 2023

@boreq Shoot. That system has a bunch of possible race condition paths and is not well-synchronized with sbot, as I discovered when fixing TestPeople. I'll have to do some more work on that. Thanks!

@KyleMaas
Copy link
Contributor Author

KyleMaas commented Feb 5, 2023

@boreq Thanks for the pointer - see #323, where I tied those indexes into sbot.

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

No branches or pull requests

3 participants