Repository navigation
feat(statediff): refill directly from frozen IAVL - #7
Open
littlehand26 wants to merge 23 commits into
Open
littlehand26 wants to merge 23 commits into
littlehand26 wants to merge 23 commits into
Conversation
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Signed-off-by: lihe <he.li@debank.com>
Comment on lines
+129
to
+133
| for label, diff := range map[string]dtypes.BlockStorageDiff{"old": oldDiff, "new": newDiff} { | ||
| if diff.Hash != root || diff.ParentHash != parent { | ||
| return fmt.Errorf("%s body root mismatch", label) | ||
| } | ||
| } |
| if err != nil { | ||
| return err | ||
| } | ||
| defer file.Close() |
Comment on lines
+231
to
+239
| for key, newValue := range newValues.Values { | ||
| oldValue, ok := oldValues.Values[key] | ||
| switch { | ||
| case !ok: | ||
| stats.Added++ | ||
| case oldValue != newValue: | ||
| stats.Changed++ | ||
| } | ||
| } |
Comment on lines
+240
to
+244
| for key := range oldValues.Values { | ||
| if _, ok := newValues.Values[key]; !ok { | ||
| stats.Removed++ | ||
| } | ||
| } |
| elapsed := finished.Sub(started).Seconds() | ||
| rate := float64(0) | ||
| if elapsed > 0 { | ||
| rate = float64(invocationProcessed) / elapsed |
| GeneratedRecords: generatedRecords.Load(), ReusedRecords: reusedRecords.Load(), Concurrency: 1, | ||
| CacheSize: options.CacheSize, ZlibLevel: options.ZlibLevel, DurationSeconds: duration.Seconds(), | ||
| HandledBlocksPerSecond: float64(records) / duration.Seconds(), | ||
| GeneratedBlocksPerSecond: float64(generatedRecords.Load()) / duration.Seconds(), |
| Files: len(legacyRanges), GeneratedFiles: generatedFiles.Load(), ReusedFiles: reusedFiles.Load(), Records: records, | ||
| GeneratedRecords: generatedRecords.Load(), ReusedRecords: reusedRecords.Load(), Concurrency: 1, | ||
| CacheSize: options.CacheSize, ZlibLevel: options.ZlibLevel, DurationSeconds: duration.Seconds(), | ||
| HandledBlocksPerSecond: float64(records) / duration.Seconds(), |
| "io" | ||
| "os" | ||
| "path/filepath" | ||
| "runtime" |
| "io" | ||
| "os" | ||
| "path/filepath" | ||
| "reflect" |
Comment on lines
+181
to
+184
| go func() { | ||
| groupDone <- group.Wait() | ||
| close(results) | ||
| }() |
This branch has not been deployed
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.
Problem
Legacy archive lifecycle metadata is incomplete before height 6,347,789, so historical StorageDiff cannot be reconstructed reliably from orphan records. Direct N-1/N IAVL traversal is correct but needs resumable S3 refill and better locality.
Solution
--iavl-run-heightsfor measured 64/128/256 A/B runsTests
go test -mod=readonly -tags=objstore ./cmd/statediff-rewriter -count=1go test -mod=readonly -race -tags=objstore ./cmd/statediff-rewriter -run TestIterateParallelDirect -count=10go vet -mod=readonly -tags=objstore ./cmd/statediff-rewritergit diff --check