| 75 | == Splitting up transactions == |
| 76 | |
| 77 | So, there is a problem right now with our single-transaction behaviour. |
| 78 | |
| 79 | Imagine this dependency graph, where green nodes are in the profile, yellow ones are dependencies that are not specified directly in the profile and red nodes are nodes that shall be removed: |
| 80 | |
| 81 | |
| 82 | Both smithers and mrburns are specified directly in the profile. But the distribution recalls that smithers depends on mrburns, so it adds a dependency. At the same time, we decide mrburns is not a critical part of our infrastructure, so we remove it from the profile: |
| 83 | |
| 84 | When the component kicks in, it looks at ''leaf'' packages that are not in the profile. Since `smithers` hasn't been updated, it runs this check against a system that looks like this: |
| 85 | |
| 86 | Thus, we'll schedule mrburns for removal. Our transaction will thus be: |
| 87 | |
| 88 | ``` |
| 89 | remove mrburns |
| 90 | distro-sync |
| 91 | ``` |
| 92 | |
| 93 | Which means this dependency graph: |
| 94 | |
| 95 | We cannot update smithers because mrburns will be removed!! Curretly this requires manual intervention, or intermediate deployments. Neither option is acceptable. |
| 96 | |
| 97 | Making the component discover this type of dependency with this set of steps would be error-prone. And removing a single package would take hours, literally. |
| 98 | |
| 99 | To fix this I'd like to ensure the third situation doesn't ever happen. |
| 100 | |
| 101 | === Running yum distro-sync at the beginning of the component === |
| 102 | |
| 103 | The problem is that the third graph is derived from incomplete information. What we'll do, thus, is to run `yum distro-sync` early in the component. After this step, the component will discover that smithers cannot be without mrburns. And it won't try to remove mrburns. |
| 104 | |
| 105 | We'll start again: |
| 106 | |
| 107 | and distro-sync will leave our system: |
| 108 | |
| 109 | and we'll be happy! |
| 110 | |