Skip to content

Comments

[v18] Improve teleport backend clone#63635

Merged
rosstimothy merged 1 commit intobranch/v18from
tross/backport-63289/v18
Feb 10, 2026
Merged

[v18] Improve teleport backend clone#63635
rosstimothy merged 1 commit intobranch/v18from
tross/backport-63289/v18

Conversation

@rosstimothy
Copy link
Contributor

@rosstimothy rosstimothy commented Feb 9, 2026

Backport #63289 to branch/v18

Changelog

changelog: Improved performance and user experience of teleport backend clone.

Test Plan

  • All items from the source backend are copied to the destination
  • Output messages are emitted by default
  • Clone status is periodically emitted
  • Successful runs are indicated by output to users
  • Failed runs are indicated by output to users

@rosstimothy rosstimothy added backport no-changelog Indicates that a PR does not require a changelog entry labels Feb 9, 2026
@rosstimothy rosstimothy marked this pull request as ready for review February 9, 2026 15:45
@public-teleport-github-review-bot public-teleport-github-review-bot bot removed the request for review from espadolini February 9, 2026 17:48
@rosstimothy rosstimothy removed the no-changelog Indicates that a PR does not require a changelog entry label Feb 10, 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)
```
@rosstimothy rosstimothy force-pushed the tross/backport-63289/v18 branch from eaf0f2f to 1275dd4 Compare February 10, 2026 19:28
@rosstimothy rosstimothy added this pull request to the merge queue Feb 10, 2026
Merged via the queue into branch/v18 with commit 9a94677 Feb 10, 2026
39 checks passed
@rosstimothy rosstimothy deleted the tross/backport-63289/v18 branch February 10, 2026 20:07
@doggydogworld doggydogworld mentioned this pull request Feb 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants