Repository navigation
#473 を実装する(スプリント m8c) - #480
Merged
Merged
Conversation
復元前バックアップの名前 pre-restore-<時刻> が既にある世代(ディレクトリ・リンク・ snapshot.yml のエントリ)と重なったら、-2・-3 … を付けた名前のディレクトリを mkdir で 排他的に作る。復元元が同じ秒の pre-restore-* でも展開の前に置き換わらず、同じ秒の 2 回の復元で控えが 2 つ残る。設計 F3 を縛っていたテストを新しい振る舞いへ書き換えた。 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
takemi-ohama
marked this pull request as ready for review
October 12, 2026 18:06
This was referenced Oct 12, 2026
Merged
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.
同じ秒に復元前バックアップが重なった場合に、通し番号を付けた名前で新しい世代を作るようにしました。既にある世代を作り直すことはありません(#473)。仕様の文書も、この名前の規則に合わせて直しています。
利用者向けの変化
移行の手順
変更の要点
lib/devbase/snapshot/manager.py: 同じ秒の復元前バックアップは通し番号の名前で作り、既にある世代を作り直さないようにした。docs/specifications/snapshot-series.md: 復元前バックアップが重なる件を作り直しの場面から外した。通し番号の名前の規則を書き加えた。CHANGELOG.md: 今回の変更を追記した。テスト
tests/snapshot/test_pre_restore_backup.pyにテストを足し、tests/snapshot/test_rebuild_generation.pyのテストを広げた。設計と違う点
設計の決定と違えたところ
pre-restore-<時刻>-2、それも重なれば-3… の名前で新しく作り、既にある世代には触りません。backups/にその名前のディレクトリかシンボリックリンクがあるとき、またはsnapshot.ymlにその名前のエントリがあるときです。ディレクトリの無いエントリだけが残っている名前も避けます(そのまま使うと_update_global_metadataが既存のエントリを書き換えるため)。ディレクトリはmkdirで排他的に作り、同じ秒に並んだ復元が同じ名前を取り合わないようにしました(新しい関数_claim_pre_restore_dir)。snapshot.ymlを読めないなど)も、ほかの失敗と同じく警告 1 行で控え無しの復元を続けます。消すのは、その呼び出しで作ったディレクトリだけです。確かめたこと
test_pre_restore_backup_rebuilds_an_existing_generationを 4 件のテストへ書き換えました(既にある世代とエントリが 1 バイトも変わらないこと・-2も重なれば次の番号へ進むこと・同じ秒のpre-restore-*を復元すると打つ前の中身を展開すること・同じ秒の 2 回の復元で控えが 2 つ残ること)。manager.pyを変更の前の形に戻すと、この 4 件が落ちることを確かめました。tests/snapshot/test_pre_restore_backup.pyに 2 件を足しました(重なったときに控えが失敗しても、作った方だけを消すこと・通し番号の名前が名前の検証を通り、同じ系列で保持されること)。pytest testsの全件が通りました(4348 passed, 31 skipped)。実のボリュームを使う確認(devbase up・実機での restore)は行っていません。残した事項
モード: standard / 通した工程: 実装 → 完了判定 → Pull Request
🤖 Generated with Claude Code