Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SDKv2 PlanResourceChange truncates big integers #2284

Closed
VenelinMartinov opened this issue Aug 6, 2024 · 3 comments · Fixed by #2286
Closed

SDKv2 PlanResourceChange truncates big integers #2284

VenelinMartinov opened this issue Aug 6, 2024 · 3 comments · Fixed by #2286
Assignees
Labels
kind/bug Some behavior is incorrect or out of spec
Milestone

Comments

@VenelinMartinov
Copy link
Contributor

What happened?

In pulumi/pulumi-gcp#2280 we discovered that PRC does not handle big integers correctly.

This needs to be addressed before rolling out PRC to GCP.

Example

.

Output of pulumi about

.

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction.
To contribute a fix for this issue, leave a comment (and link to your pull request, if you've opened one already).

@VenelinMartinov VenelinMartinov added the kind/bug Some behavior is incorrect or out of spec label Aug 6, 2024
@VenelinMartinov
Copy link
Contributor Author

This seems to be 2 issues rolled up into one:

  1. We truncate big integers when creating the resource because we do a round-trip to JSON, which uses float64, instead of json.Number.
  2. We truncate big integers when running the upgradeState TF function.

1 is fixed by #2286

I have not yet been able to pull a repro for 2 in the bridge. I have also not had any luck in identifying the source of this - it seems to be TF but that should not be the case.

@VenelinMartinov
Copy link
Contributor Author

The second truncation seems to be happening here:

newState, newMeta, err := upgradeResourceStateGRPC(ctx, t, res, state.stateValue, state.meta, p.server.gserver)

which calls the TF UpgradeResourceState GRPC here:

resp, err := server.UpgradeResourceState(ctx, &tfprotov5.UpgradeResourceStateRequest{

@VenelinMartinov
Copy link
Contributor Author

The second truncation was an artefact of my local testing environment. I had the wrong version of the plugin-sdk checked out, which did not contain the latest modifications there (upstream-v2.33.0 instead of upstream-v2.33.0-with-272df8b).

This issue is fixed by #2286.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Some behavior is incorrect or out of spec
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants