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

Signed id/size in database tables #1229

Closed
SeanBurford opened this issue Sep 21, 2024 · 1 comment · Fixed by #1232
Closed

Signed id/size in database tables #1229

SeanBurford opened this issue Sep 21, 2024 · 1 comment · Fixed by #1232
Assignees

Comments

@SeanBurford
Copy link

Google's Argon and Xenon logs contain around 2.3B records. A signed integer can handle the range +/-2.1B.

When cloning Argon I get this message:

E0921 06:55:56.360252  685659 database.go:135] tx.Exec(): Error 1264 (22003): Out of range value for column 'id' at row 1
E0921 06:55:56.360316  685659 database.go:135] tx.Exec(): Error 1264 (22003): Out of range value for column 'id' at row 1
E0921 06:55:56.360383  685659 database.go:135] tx.Exec(): Error 1264 (22003): Out of range value for column 'id' at row 1
...

By inspection it looks like all that is needed is to alter the leaves and checkpoints tables to use integer unsigned for id and size respectively. The code all seems to use uint64 so once the database has an unsigned int we should be ok up to 4.2B entries. I'm backing up my database before altering the table, so have not tested that change yet.

Here is where the keys are defined as signed:
https://github.com/google/trillian-examples/blob/master/clone/logdb/database.go#L59-L62

@mhutchinson
Copy link
Contributor

Good spot. Yeah, these keys should be unsigned BIGINT.

mhutchinson added a commit to mhutchinson/trillian-examples that referenced this issue Sep 23, 2024
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 a pull request may close this issue.

2 participants