Commit d514de3
committed
em: recover orphaned ua_target_resources on restart
When the EM-builder creates a ua_target_resource but the subsequent
em_resources.target_resource update is lost (crash, restart), the next
run finds em_resources.target_resource=NULL but ua_target_resources
already holds a record for the same deterministic res_uuid.
The previous code called insert() unconditionally, which triggered a
ConflictRecords exception and aborted the DB transaction. Any query in
the same session after the abort also failed, so em_resources was never
updated — creating an infinite recovery loop that blocked actualization
of all dependent resources.
Fix: check for an existing record by res_uuid before inserting. If
found, link it to em_resources and return so the next iteration can
compare hashes normally.1 parent 37fac47 commit d514de3
3 files changed
Lines changed: 22 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
845 | 845 | | |
846 | 846 | | |
847 | 847 | | |
| 848 | + | |
| 849 | + | |
| 850 | + | |
| 851 | + | |
| 852 | + | |
| 853 | + | |
| 854 | + | |
| 855 | + | |
| 856 | + | |
| 857 | + | |
| 858 | + | |
| 859 | + | |
| 860 | + | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
848 | 865 | | |
849 | 866 | | |
850 | 867 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments