pulumi/pkg/engine
Pat Gavlin d18b59e9c6
Fix a dependency graph bug during DBR. (#3329)
The dependency graph used to determine the set of resources that
depend on a resource being DBR'd is constructured from the list of
resource states present in the old snapshot. However, the dependencies
of resources that are present in both the old snapshot and the current
plan can be different, which in turn can cause the engine to make
incorrect decisions during DBR with respect to which resources need to
be replaced. For example, consider the following program:

```
var resA = new Resource("a", {dbr: "foo"});
var resB = new Resource("b", {dbr: resA.prop});
```

If this program is then changed to:
```
var resB = new Resource("b", {dbr: "<literal value of resA.prop>"});
var resA = new Resource("a", {dbr: "bar"});
```

The engine will first decide to make no changes to "b", as its input
property values have not changed. "b" has changed, however, such that it
no longer has a dependency on "a".

The engine will then decide to DBR "a". In the process, it will
determine that it first needs to delete "b", because the state for "b"
that is used when calculating "a"'s dependents does not reflect the
changes made during the plan.

To fix this issue, we rely on the observation that dependents can only
have been _removed_ from the base dependency graph: for a dependent to
have been added, it would have had to have been registered prior to the
root--a resource it depends on--which is not a valid operation. This
means that any resources that depend on the root must not yet have
been registered, which in turn implies that resources that have already
been registered must not depend on the root. Thus, we ignore these
resources if they are encountered while walking the old dependency graph
to determine the set of dependents.
2019-10-12 17:22:13 -07:00
..
destroy.go Add --server to pulumi plugin install 2019-06-03 09:31:18 -07:00
diff.go Print destroyed outputs when a stack is destroyed. (#3261) 2019-09-24 17:15:46 -07:00
engine.go Add an API for importing stack outputs (#2180) 2018-11-14 13:33:35 -08:00
errors.go Show a better error message when decrypting fails (#1815) 2018-08-22 15:32:54 -07:00
events.go Print PolicyPacks run as part of update summary 2019-09-30 14:49:21 -07:00
eventsink.go Make a smattering of CLI UX improvements 2018-09-24 08:43:46 -07:00
lifecycle_test.go Fix a dependency graph bug during DBR. (#3329) 2019-10-12 17:22:13 -07:00
plan.go Add support for updating a subset of resources in the stack (i.e. --target) (#3251) 2019-09-30 23:41:56 -07:00
plugins.go Add more details to an assert (#3129) 2019-08-28 11:28:04 -07:00
plugins_test.go Load default providers deterministically (#2590) 2019-03-26 13:29:34 -07:00
project.go Use PulumiPolicy.yaml instead of Pulumi.yaml for PolicyPacks 2019-10-10 10:15:51 -07:00
query.go Improve tracing support. (#3238) 2019-09-16 14:16:43 -07:00
refresh.go Add --server to pulumi plugin install 2019-06-03 09:31:18 -07:00
snapshot.go Remove uses of plugins in the snapshot (#2662) 2019-04-23 09:53:44 -07:00
update.go Add local policy packs to summary event (#3308) 2019-10-09 13:50:28 -07:00