[v18] Improve teleport backend clone#63635
Merged
rosstimothy merged 1 commit intobranch/v18from Feb 10, 2026
Merged
Conversation
okraport
approved these changes
Feb 9, 2026
zmb3
approved these changes
Feb 9, 2026
UX changes:
Progress of the clone operation is now logged every 250ms
instead of a single time after a 1s delay. This helps users know
that cloning is active and doing something. The total number of items
copied and items that failed to be cloned is also logged at the conclusion
of the command.
Friendly messages are emitted at the conclusion of the command to let
users know if there is any action on their part.
Performance changes:
Clone now makes use of backend.Items instead of backend.GetRange. This
helps reduce allocations since each page doesn't need to be provided one
slice at a time. Instead of broadcasting each item from the GetRange result
to a channel, we now spawn new work directly while processing each item
when iterating the backend.Items.
The number of allocations required to process each item has also been
reduced by holding off on creating a retry object until an error is
encountered pushing an item to the new backend.
Comparison of BenchmarkClone before and after this change below.
```bash
benchstat old.txt new.txt
goos: darwin
goarch: arm64
pkg: github.com/gravitational/teleport/lib/backend
cpu: Apple M2 Pro
│ old.txt │ new.txt │
│ sec/op │ sec/op vs base │
Clone-12 146.2m ± 2% 148.5m ± 1% ~ (p=0.165 n=10)
│ old.txt │ new.txt │
│ B/op │ B/op vs base │
Clone-12 12.380Mi ± 0% 5.489Mi ± 0% -55.66% (p=0.000 n=10)
│ old.txt │ new.txt │
│ allocs/op │ allocs/op vs base │
Clone-12 94.39k ± 0% 72.06k ± 0% -23.66% (p=0.000 n=10)
```
eaf0f2f to
1275dd4
Compare
Merged
1 task
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.
Backport #63289 to branch/v18
Changelog
changelog: Improved performance and user experience of
teleport backend clone.Test Plan