News for hackers. Stuff that matters.
Re:AWS vs. GCP reliability is wildly different by stevenguh on Thursday September 22, 2022 @02:04AM (#32935240)
GCP control plane is generally not idempotent.

When trying to create the same resource twice, all request should report the same status instead one failing, one succeeding.

In AWS, their APIs allow you to supply a client token if the API is not idempotent by default.

See https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_I....

Re:AWS vs. GCP reliability is wildly different by jsolson on Thursday September 22, 2022 @02:23AM (#32935354)
> When try to create the same resource twice, the second should report success instead of failing.

Before I quibble with the idempotency point: I agree with this, entirely, but it is what it is and a lot of software has been written against the current behavior. So I'll cite Hyrum's law here: https://www.hyrumslaw.com/

> GCP control plane is generally not idempotent.

The GCE API occupies an odd space here, imo. The resource being created is, in practice, an operation to cause the named VM to exist. The operation has its own name, but the name of the VM in the insert operation is the name of the ultimate resource.

Net, the API is idempotent at a macro level in terms of the end-to-end creation or deletion of uniquely named resources. Which is a long winded way of saying that you're right, but that from a practical perspective it accomplishes enough of the goals of a truly idempotent API to be _useful_ for avoiding the same things that the AWS mechanism avoids: creation of unexpected duplicate VMs.

The more "modern" way to do this would be to have a truly idempotent description of the target state of the actual resource with a separate resource for the current live state, but we live with the sum of our past choices.

Re:AWS vs. GCP reliability is wildly different by Terretta on Thursday September 22, 2022 @06:45AM (#32937123)
It's a lot shorter to write:

You're right, we did it wrong.

// And paradoxically makes engineers like you.

Re:AWS vs. GCP reliability is wildly different by jsolson on Thursday September 22, 2022 @11:04AM (#32939851)
Sure, except I think that at a macro level we got it more right than AWS, despite some choices that I believe we'd make differently today.
Re:AWS vs. GCP reliability is wildly different by akramer on Thursday September 22, 2022 @11:24AM (#32940178)
The GCE API can be idempotent if you'd like. Fill out the requestId field with the same UUID in multiple instances.insert calls (or other mutation calls) and you will receive the same operation Id back in response.

Disclaimer: I work on GCE.

Re:AWS vs. GCP reliability is wildly different by jsolson on Thursday September 22, 2022 @01:28PM (#32942029)
Today I learned! I'll admit I didn't know this functionality existed, and I've instead had used instances.insert following by querying the VM resource.

This is nicer!