Skip to content

Backport #19405 to slack-22.0#814

Open
maksimov wants to merge 2 commits intoslack-22.0from
stas-restore-hook-v22
Open

Backport #19405 to slack-22.0#814
maksimov wants to merge 2 commits intoslack-22.0from
stas-restore-hook-v22

Conversation

@maksimov
Copy link

@maksimov maksimov commented Mar 6, 2026

Description

Summary

  • Extract hook logic into invokeRestoreDoneHook helper, called from both RestoreBackup (startup) and RestoreFromBackup (RPC) paths
  • Pass backup engine name to hook via TM_RESTORE_DATA_BACKUP_ENGINE env var
  • Return backup engine from restoreDataLocked

Previously, restores triggered via vtctldclient RestoreFromBackup never fired the vttablet_restore_done hook.

Backport of upstream vitessio#19405 + follow-up RPC path fix (posted today to vitessio#19592 as well).

Test plan

  • Trigger a restore via vtctldclient RestoreFromBackup on a staging tablet
  • Verify vttablet_restore_done hook is executed (visible in vttablet logs)
  • Verify hook receives correct env vars: TM_RESTORE_DATA_START_TS, TM_RESTORE_DATA_STOP_TS, TM_RESTORE_DATA_DURATION,
    TM_RESTORE_DATA_BACKUP_ENGINE

Related Issue(s)

Checklist

  • "Backport to:" labels have been added if this change should be back-ported to release branches
  • If this change is to be back-ported to previous releases, a justification is included in the PR description
  • Tests were added or are not required
  • Did the new or modified tests pass consistently locally and on CI?
  • Documentation was added or is not required

Deployment Notes

AI Disclosure

…ass backup engine

Backport of upstream changes:
- Extract hook logic into invokeRestoreDoneHook helper
- Call the hook from both RestoreBackup (startup) and RestoreFromBackup (RPC) paths
- Pass backup engine name to hook via TM_RESTORE_DATA_BACKUP_ENGINE env var
- Return backup engine from restoreDataLocked

Signed-off-by: Stas Maksimov <smaksimov@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@maksimov maksimov requested a review from a team as a code owner March 6, 2026 15:42
@github-actions github-actions bot added this to the v22.0.3 milestone Mar 6, 2026
The conflict resolution from the cherry-pick incorrectly changed
startReplication to use context.Background(), which removes the
deadline and causes TestRestoreUnreachablePrimary to hang.

Signed-off-by: Stas Maksimov <smaksimov@slack-corp.com>
Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@codecov-commenter
Copy link

Codecov Report

❌ Patch coverage is 34.09091% with 29 lines in your changes missing coverage. Please review.
✅ Project coverage is 69.80%. Comparing base (b1ab347) to head (99f744d).
⚠️ Report is 36 commits behind head on slack-22.0.

Files with missing lines Patch % Lines
go/vt/vttablet/tabletmanager/restore.go 36.58% 26 Missing ⚠️
go/vt/vttablet/tabletmanager/rpc_backup.go 0.00% 3 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff               @@
##           slack-22.0     #814      +/-   ##
==============================================
+ Coverage       67.53%   69.80%   +2.27%     
==============================================
  Files            1600     1606       +6     
  Lines          261782   214099   -47683     
==============================================
- Hits           176786   149454   -27332     
+ Misses          84996    64645   -20351     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants