pulumi/pkg
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
..
apitype Print PolicyPacks run as part of update summary 2019-09-30 14:49:21 -07:00
backend Use PulumiPolicy.yaml instead of Pulumi.yaml for PolicyPacks 2019-10-10 10:15:51 -07:00
codegen/python Creation of generator package (#2970) 2019-07-22 17:09:35 -07:00
diag Stop using loreley. (#3331) 2019-10-12 13:53:57 -07:00
encoding
engine Fix a dependency graph bug during DBR. (#3329) 2019-10-12 17:22:13 -07:00
graph
npm fix: node_modules typo (#3175) 2019-09-09 23:11:35 +03:00
operations Collect logs from Google Cloud Functions 2019-04-08 09:44:05 -07:00
resource Fix a dependency graph bug during DBR. (#3329) 2019-10-12 17:22:13 -07:00
secrets Cache ciphertext for secret properties. (#3183) 2019-09-18 15:52:31 -07:00
testing Override all options in ProgramTest.With (#3264) 2019-10-07 14:11:36 +03:00
tokens Fix comment about QName regex (#3121) 2019-08-20 14:43:48 -07:00
tools Add a WriteString method to tools/GenWriter. (#1839) 2018-08-29 14:43:20 -07:00
util Add codefresh CI detection. Thanks to @fernandocarletti. (#3270) 2019-09-25 14:41:13 -07:00
version
workspace Use PulumiPolicy.yaml instead of Pulumi.yaml for PolicyPacks 2019-10-10 10:15:51 -07:00