pulumi/pkg/backend
Matt Ellis 828086d638 Do not attempt to load checkpoint before saving a snapshot
For historical reasons, we used to need to require to load an existing
checkpoint to copy some data from it into the snapshot when saving a
new snapshot. The need for this was removed as part of the general
work in #2678, but we continued to load the checkpoint and then just
disregard the data that was returned (unless there was an error and
that error was not FileNotFound, in which case we would fail).

Our logic for checking if something was FileNotFound was correct when
we wrote it, but when we adopted go-cloud in order to have our
filestate backend also write to blob storage backends like S3, we
forgot that we had checks like `os.IsNotExists()` floating around
which were now incorrect. That meant if the file did not exist for
some reason, instead of going along as planned, we'd error out now
with an error saying something wasn't found.

When we write a checkpoint, we first "backed up" the initial version
by renaming it to include a `.bak` suffix, then we write the new file
in place. However, this can run afoul of eventual consistency models
like S3, since there will be a period of time in which a caller may
observe that the object is missing, even after a new version is
written (based on my understanding of [S3's consistency
model](https://docs.aws.amazon.com/AmazonS3/latest/dev/Introduction.html#ConsistencyModel)

Since we no longer need to actually copy any information from the
previous checkpoint, we can simply remove the call entirely to load
it.

As a follow up, we need to audit places inside the filebased backend
that assume `os.*` functions are going to do what we want them to do,
since in general they will not.

Fixes #2714
2019-08-16 13:40:55 -07:00
..
display Disable interactive-terminal spinner when on a CI machine. (#3070) 2019-08-13 12:50:09 -07:00
filestate Do not attempt to load checkpoint before saving a snapshot 2019-08-16 13:40:55 -07:00
httpstate Emit stderr of npm install 2019-08-13 12:48:16 -07:00
state Add license headers 2018-05-22 15:02:47 -07:00
apply.go Don't print error prefix when a confirmation prompt is declined 2019-03-26 15:17:18 -07:00
backend.go Address comments 2019-07-16 00:58:33 -07:00
backend_test.go Address lint warnings 2019-07-16 00:58:33 -07:00
policypack.go Add pulumi policy apply command 2019-07-16 00:58:33 -07:00
snapshot.go Addition of Custom Timeouts (#2885) 2019-07-16 00:26:28 +03:00
snapshot_test.go Pass ignoreChanges to providers. (#3005) 2019-07-31 11:39:07 -05:00
stack.go Allow using the passphrase secrets manager with the pulumi service 2019-05-10 17:07:52 -07:00
updates.go Remove the GitHubLogin and GitHubRepo update metadata keys (#2732) 2019-05-29 11:22:59 -07:00