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
Repo history rewrite #1479
Repo history rewrite #1479
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lookin real nice! It was great to see a lot of the complex bookkeeping fade away here.
packages/pds/src/sql-repo-storage.ts
Outdated
qb | ||
.where('repoRev', '>', cursor.rev) | ||
.orWhere((inner) => | ||
inner | ||
.where('repoRev', '=', cursor.rev) | ||
.where('cid', '>', cursor.cid.toString()), | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would recommend using this pattern to ensure you hit the index: ("repoRev", "cid") > (${cursor.rev}, ${cursor.cid})
. Shouldn't really be necessary, but we've seen it miss the index the other way for sure 🙃
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah good looks 👍 simpler too
* logical changes in repo * tests * tweak commit data * building pds * patching up some tests * tidy + more tests * patch up bsky * clean up db * db migration * small patches * fix up another test * reinclude prevs * api & lex updates * add back in deprecated routes * backward compatibility for commit v2 * add upgrade repo version root * move namespace * migration test * patch up a few more tests * remove deprecated rebase routes * tweak api * sprinkle rev around a few more places * getCurrent -> getLatestCommit * fix test * pr feedback & tidy * fix up block pagination * tidy again * add in a tets * add cursor to listBlobs * getRepo rev -> since * clean up proofs test * dont change getHead * tweak migrate route * build branch * hit index in block range query * check for dupe record refs * tidy * set prev to null * dont build branch
* logical changes in repo * tests * tweak commit data * building pds * patching up some tests * tidy + more tests * patch up bsky * clean up db * db migration * small patches * fix up another test * reinclude prevs * api & lex updates * add back in deprecated routes * backward compatibility for commit v2 * add upgrade repo version root * move namespace * migration test * patch up a few more tests * remove deprecated rebase routes * tweak api * sprinkle rev around a few more places * getCurrent -> getLatestCommit * fix test * pr feedback & tidy * fix up block pagination * tidy again * add in a tets * add cursor to listBlobs * getRepo rev -> since * clean up proofs test * dont change getHead * tweak migrate route * build branch * hit index in block range query * check for dupe record refs * tidy * set prev to null * dont build branch
Removes history from repos, introduces new sync semantics, and provides an upgrade path to repo v3.
Adds a temporary admin
com.atproto.temp.upgradeRepoVersion
route through which we can upgrade repos at our own pace.More discussion here: #1410
Blog post with discussion of changes here: https://atproto.com/blog/repo-sync-update
Note for reviewing: I would review this in in the following order