Skip to content

gitbase: implement table checksums #670

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

Merged
merged 3 commits into from
Jan 14, 2019
Merged

gitbase: implement table checksums #670

merged 3 commits into from
Jan 14, 2019

Conversation

erizocosmico
Copy link
Contributor

Closes #661

Depends on src-d/go-mysql-server#583

Tests will fail until that PR is merged and this is updated.

Basically, this implements the new sql.Checksumable interface in each table so the engine can perform the checksums on the repos.

How is the checksum implemented?
With a hash built using the repo ID, all the reference names and the hashes they point to and the checksum of all their packfiles.

If there's a single thing of those that changed, the checksum will be different.

Bad part of this? Pool is needed again in the tables :/ The checksums are checked as part of the init phase of the engine, and there is no context to get the repos from.

Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
@erizocosmico erizocosmico requested a review from a team January 11, 2019 14:37
buf.WriteString(head.Hash().String())
}

refs, err := repo.References()
Copy link
Contributor

Choose a reason for hiding this comment

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

It may not work. I came across situation where ref iterator returns refs in random order - we have to double check it.

@kuba--
Copy link
Contributor

kuba-- commented Jan 11, 2019

table.go:12: undefined: sql.Checksumable

@erizocosmico
Copy link
Contributor Author

erizocosmico commented Jan 11, 2019 via email

Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
@erizocosmico
Copy link
Contributor Author

go-mysql-server PR was already merged, so just updated the dependency and tests should be working fine now.

@erizocosmico
Copy link
Contributor Author

Fixed

@ajnavarro ajnavarro merged commit ff072ec into src-d:master Jan 14, 2019
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 this pull request may close these issues.

4 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy