Repository navigation
Conversation
|
Review record for #16420, carried over from the mirror it was reviewed on: danielhanchen/unsloth-staging-review#680. Findings are quoted as posted and attributed to the account that posted them. The reactions shown are the triage recorded on the mirror; none were re-applied here. Commits are named as the mirror's, with this PR's equivalent where one was found. Round 1: reviewed mirror
|
|
Further recovery testing found a regression after deleting and reimporting a chat. Import one turn, delete the last chat, then interrupt its reimport with a failing checkpoint write: the message rolls back, but the deleted chat's old checkpoint remains. After appending a second turn, retry stores only The correction clears an obsolete checkpoint in the same transaction that recreates a missing thread. It preserves checkpoints and intentional message deletions in surviving threads. The new regression fails on this PR and passes with the correction; the broader storage/import/archive/research/generation selection passes all 590 tests without skips. Direct maintainer pushes and a follow-up PR into this branch were both refused. I preserved your commits in #16458 and added the correction there. The correction alone is commit 2dd439b3f, which can also be cherry-picked into this branch. |
…slothai#16458) Preserve imported messages and their progress checkpoint in one SQLite transaction, and discard a deleted chat's stale checkpoint atomically when recreating its thread. Retries recover every source turn while retaining edits and message deletions in surviving threads. Includes the original atomic-import work from unslothai#16420 and the deleted-chat recovery correction. Fixes unslothai#16419. Co-authored-by: Henry Su <[email protected]>
|
The atomic-import work is merged in #16458, with your original contribution credited and the additional deleted-chat checkpoint recovery fix included. Closing this PR as superseded so the incomplete version is not merged separately. Thank you for the original fix and reproducer. |
Why
Retrying a failed external-chat import can permanently skip later source turns. Message rows committed before their progress checkpoint, leaving a state the importer cannot safely replay.
What changed
Scope
This prevents new partial message/checkpoint commits. It does not infer historical missing checkpoints from edited or deleted rows. Thread/project metadata keeps its existing separate write path.
Tradeoffs
An optional checkpoint on message sync avoids extracting its large transaction body. Imports with no message changes retain their existing checkpoint-only write.
Blast Radius
Other message-sync callers omit the optional checkpoint and keep their behavior. No schema migration or shared connection state is added.
Verification
test_external_import_atomic.py: 2 failed, 1 passed on current main; 3 passed with the fix. Reverting importer integration or splitting the storage transaction reproduces both failures.Closes #16419.