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

Prepare log-index lookup for sharding #629

Closed
lkatalin opened this issue Jan 28, 2022 · 4 comments · Fixed by #671
Closed

Prepare log-index lookup for sharding #629

lkatalin opened this issue Jan 28, 2022 · 4 comments · Fixed by #671
Labels
enhancement New feature or request

Comments

@lkatalin
Copy link
Contributor

The log-index lookup should resolve the virtual index to the treeID + index for a specific shard.

@lkatalin lkatalin added the enhancement New feature or request label Jan 28, 2022
@lkatalin
Copy link
Contributor Author

lkatalin commented Feb 8, 2022

Since GetLogEntryByIndexHandler() instantiates a trillian client to query based on the NewTrillianClient() command, which takes the treeID/logID[1] from a default in api during server set-up in serve.go, it seems that the necessary change (if any) would be not in the GetLogEntryByIndexHandler() function itself, but in the way the TreeID is set during API configuration.

Currently this seems to be set once via a flag when the Rekor server is first run, which made sense when there was only one tree but probably won't make sense anymore.[2] I think the Rekor server set-up would have to be decoupled from instantiating new trillian clients (as it's one client per treeID from what I can tell). Does this sound right?

[1] Am I reading correctly that the API's logID is equivalent to a trillian TreeID? Should these terms be merged?

[2] The logRangesMap also appears to be passed in via a flag as if the user is supposed to provide this. What is the way this is intended to be used?

Tagging @dlorenc @bobcallaway for any guidance - thanks!

@lkatalin
Copy link
Contributor Author

lkatalin commented Feb 8, 2022

[1] Am I reading correctly that the API's logID is equivalent to a trillian TreeID? Should these terms be merged?

I was able to grab @dlorenc for a brief meeting and he confirmed these two terms do refer to the same thing.

[2] The logRangesMap also appears to be passed in via a flag as if the user is supposed to provide this. What is the way this is intended to be used?

My current question is still around how the logRangesMap flag is meant to be used - I was thinking of logRanges being a global var that gets updated when a new artifact is uploaded (adds to active tree len) or when a new shard is created (freezes last tree, adds new active tree). I've grabbed another slot with @dlorenc on Thurs morning, but if someone is able to comment on this beforehand that would help me get to working on it faster. Thanks!

@lkatalin
Copy link
Contributor Author

lkatalin commented Feb 8, 2022

Ex. is sending a command to the Rekor server that includes this logRangesMap flag + value supposed to create a new TrillianClient with updated treeID?

@lkatalin
Copy link
Contributor Author

Notes from my meeting with @dlorenc :

  • The server is going to restart every time we shard. That's when this logRangesMap flag is passed in with new info.

  • I'm not really worrying about calculating the correct thing to pass in via the logRangesMap flag - this is largely manual.

  • Don't currently need to edit config/rekor.yaml

  • The todo is creating or choosing the correct trillian client based on the logRangesMap:

    • For a write, get the active index and talk to it
    • For a read, we can create multiple trillian clients (at startup or on the fly) -> I think it's best to do it on the fly in the handler

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant