Commit 6f2ca15
committed
fix(sync): key ownership baselines and rehydration on stored attribution
Two more paths still derived a machine instead of carrying the stored one.
Rehydrated reconciliation candidates dropped candidate.Machine when building
their DiscoveredFile, so workers recomputed attribution from the physical
source path. That is wrong for providers whose source can sit outside the
labeled root it was configured under, and it could retire a valid labeled
baseline and lose later deletions. Both rehydration branches now carry the
candidate's machine, matching what baselineReconciliationCandidates already
expects.
Ownership baselines keyed on the freshly parsed machine, but prepareSessionWrite
preserves an existing archive row's label, and it works on a copy that the
caller never sees. After a relabel the baseline could land under a machine no
session row holds, leaving the source untombstonable. Writes now record the
machine they persisted under and baselines key on it. The DB-backed streaming
path resolves the stored machine for the same reason; that lookup short-circuits
unless the agent actually has labeled roots, so unlabeled setups add no queries.
The added test pins that a relabel keeps both the session and its baseline on
the original machine. It documents the invariant but does not by itself
reproduce the reported pending-write mismatch; see the PR discussion.1 parent 4cde40b commit 6f2ca15
2 files changed
Lines changed: 124 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
692 | 716 | | |
693 | 717 | | |
694 | 718 | | |
| |||
4501 | 4525 | | |
4502 | 4526 | | |
4503 | 4527 | | |
| 4528 | + | |
4504 | 4529 | | |
4505 | 4530 | | |
4506 | 4531 | | |
| |||
4527 | 4552 | | |
4528 | 4553 | | |
4529 | 4554 | | |
| 4555 | + | |
| 4556 | + | |
| 4557 | + | |
| 4558 | + | |
4530 | 4559 | | |
4531 | 4560 | | |
4532 | 4561 | | |
| |||
6656 | 6685 | | |
6657 | 6686 | | |
6658 | 6687 | | |
| 6688 | + | |
| 6689 | + | |
| 6690 | + | |
| 6691 | + | |
| 6692 | + | |
| 6693 | + | |
| 6694 | + | |
6659 | 6695 | | |
6660 | | - | |
| 6696 | + | |
6661 | 6697 | | |
6662 | | - | |
| 6698 | + | |
6663 | 6699 | | |
6664 | 6700 | | |
6665 | 6701 | | |
| |||
7463 | 7499 | | |
7464 | 7500 | | |
7465 | 7501 | | |
| 7502 | + | |
| 7503 | + | |
| 7504 | + | |
| 7505 | + | |
| 7506 | + | |
| 7507 | + | |
7466 | 7508 | | |
7467 | | - | |
| 7509 | + | |
7468 | 7510 | | |
7469 | 7511 | | |
7470 | 7512 | | |
| |||
10663 | 10705 | | |
10664 | 10706 | | |
10665 | 10707 | | |
| 10708 | + | |
| 10709 | + | |
| 10710 | + | |
| 10711 | + | |
| 10712 | + | |
| 10713 | + | |
10666 | 10714 | | |
10667 | 10715 | | |
10668 | 10716 | | |
| |||
10912 | 10960 | | |
10913 | 10961 | | |
10914 | 10962 | | |
| 10963 | + | |
10915 | 10964 | | |
10916 | 10965 | | |
10917 | 10966 | | |
| |||
11887 | 11936 | | |
11888 | 11937 | | |
11889 | 11938 | | |
| 11939 | + | |
11890 | 11940 | | |
11891 | 11941 | | |
11892 | 11942 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
520 | 520 | | |
521 | 521 | | |
522 | 522 | | |
| 523 | + | |
| 524 | + | |
| 525 | + | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
0 commit comments