pulumi/pkg/resource/deploy
Fraser Waters 49d8298e84
Fix snapshot integrity on pending replacement (#17146)
This fixes a snapshot integrity issue with delete before replace, failed
creates, and multiple updates.

This was caused by https://github.com/pulumi/pulumi/pull/16510 where we
started removing pending replace resources as part of their replacement
steps. A well intentioned fix to stop trying to delete resources we'd
already deleted in a previous update.

The bug would manifest if the following happened:
1. An update goes to replace a resource with `deleteBeforeCreate` set.
It deletes the old resource (and saves the state as pending replace) but
then failed to create the new replacement resource.
2. A second update is run to try and create the replacement resource. At
this point the bug manifest and we delete the pending replace resource
from state, but then if the new resource fails to create again we end up
with an invalid snapshot.

The fix is very simple. If a resource is already pending replacement we
just don't issue a delete/remove step at all. The pending replace
resource will get cleaned up at the end by the create step creating the
new version.

Fixes #17111
Fixes #17073
Fixes #17070
Fixes #17069
Fixes #16916
2024-09-04 10:52:43 +00:00
..
deploytest debugging: more consistency for naming (#17152) 2024-09-04 10:36:45 +00:00
providers implement the engine bits for debugging support (#17072) 2024-08-30 10:31:28 +00:00
builtins.go Normalize plugin.Provider methods to (Context, Request) -> (Response, error) (#16302) 2024-06-07 19:47:49 +00:00
builtins_test.go Normalize plugin.Provider methods to (Context, Request) -> (Response, error) (#16302) 2024-06-07 19:47:49 +00:00
deployment.go implement the engine bits for debugging support (#17072) 2024-08-30 10:31:28 +00:00
deployment_executor.go continue-on-error: fix integrity issues in up with changed dependencies (#16733) 2024-07-22 11:25:33 +00:00
deployment_executor_test.go Better handle property dependencies and `deletedWith` (#16088) 2024-05-03 17:08:06 +00:00
deployment_test.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
doc.go Document Go packages (#6009) 2021-01-11 11:07:59 -07:00
import.go Extend the TestReplacementParameterizedProvider test (#16644) 2024-07-15 08:33:36 +00:00
import_test.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
manifest.go Split Manifest type to it's own file (#8712) 2022-01-10 12:25:24 +00:00
manifest_test.go Refactor: move plugin kind to apitype (#15946) 2024-04-25 17:30:30 +00:00
plan.go Enable perfsprint linter (#14813) 2023-12-12 12:19:42 +00:00
plan_test.go [ci] `pkg/resource/deploy` coverage (#14831) 2023-12-19 16:14:40 +00:00
snapshot.go Print panic banners for snapshot integrity errors (#17047) 2024-08-23 12:48:18 +00:00
snapshot_test.go Revert "Revert "Run integration tests and dev builds with race detection" (#15998)" (#16148) 2024-05-09 16:15:41 +00:00
source.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
source_error.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
source_error_test.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
source_eval.go debugging: more consistency for naming (#17152) 2024-09-04 10:36:45 +00:00
source_eval_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
source_null.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
source_query.go Initial work for parameterized providers (#16281) 2024-06-10 17:28:47 +00:00
source_query_test.go implement the engine bits for debugging support (#17072) 2024-08-30 10:31:28 +00:00
state_builder.go Revert "Revert "Run integration tests and dev builds with race detection" (#15998)" (#16148) 2024-05-09 16:15:41 +00:00
state_builder_test.go When changing parents also fix URNs (#13935) 2023-09-14 19:52:27 +00:00
step.go Don't set `PendingReplacement` until `Delete` succeeds (#16699) 2024-07-18 12:27:06 +00:00
step_executor.go Use int32 in Go interfaces that map to protobufs using int32 (#17068) 2024-08-28 13:45:17 +00:00
step_executor_test.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
step_generator.go Fix snapshot integrity on pending replacement (#17146) 2024-09-04 10:52:43 +00:00
step_generator_test.go Clean up deployment options (#16357) 2024-06-11 13:37:57 +00:00
step_test.go Update lifecycle test APIs to match provider APIs (#16793) 2024-07-26 12:14:45 +00:00
target.go Add tokens.StackName (#14487) 2023-11-15 07:44:54 +00:00
target_test.go upgrade to latest version of golangci-lint (#15977) 2024-04-19 06:20:33 +00:00