Long upgrades through multiple calls - #53
Open
vporton wants to merge 11 commits into
Open
Conversation
Author
|
Actually GPT-4.6 showed itself more creative than I did: It invented to upgrade through a separate upgrader canister, what I myself missed. |
vporton
commented
Jul 31, 2026
vporton
left a comment
Author
There was a problem hiding this comment.
I've reviewed the AI code manually and recommend the code for release.
Comment on lines
+140
to
+153
| /// Returns documents whose ids lie in the inclusive range from `start` | ||
| /// through `end`. Either bound may be null. The underlying B-tree seeks | ||
| /// directly to `start`, so this is suitable for bounded resumable work. | ||
| public func scan(start : ?T.DocumentId, end : ?T.DocumentId) : Iter<(T.DocumentId, Record)> { | ||
| let iter = StableCollection.scan(collection, start, end); | ||
|
|
||
| Iter.map<(T.DocumentId, Blob), (T.DocumentId, Record)>( | ||
| iter, | ||
| func((id, candid_blob) : (T.DocumentId, Blob)) { | ||
| (id, blobify.from_blob(candid_blob)); | ||
| }, | ||
| ); | ||
| }; | ||
|
|
Comment on lines
+138
to
+146
| public func scan(collection : T.StableCollection, start : ?T.DocumentId, end : ?T.DocumentId) : T.Iter<(T.DocumentId, Blob)> { | ||
| Iter.map<(T.DocumentId, T.CandidBlob), (T.DocumentId, Blob)>( | ||
| DocumentStore.scan(collection, start, end), | ||
| func((id, partial_candid_blob) : (T.DocumentId, T.CandidBlob)) : (T.DocumentId, Blob) { | ||
| (id, CollectionUtils.appendTypeHeaderToCandidBlob(collection, partial_candid_blob)); | ||
| }, | ||
| ); | ||
| }; | ||
|
|
Comment on lines
+44
to
+45
| import MigrationController "Migration"; | ||
| import MigrationTemplate "MigrationTemplates"; |
Comment on lines
+52
to
+53
| public let Migration = MigrationController; | ||
| public let MigrationTemplates = MigrationTemplate; |
vporton
marked this pull request as ready for review
July 31, 2026 08:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request allows to do long upgrades of tables that don't fit into a single update or upgrade request.
This is an mostly AI-generated draft pull request. I didn't read it in details yet. I will definitely study it in detail, but later.
Having it importance and possible debate, I decided to release it as a draft (WIP PR) for the community to look into it asap.
I am creating a draft pull request for community consideration because the file
tests/cluster-tests/Migration.Functional.Test.molook OK, so the general idea appears correct.