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

Ordering is important when updating backlog_quota.limit_bytes and retention_policies.retention_size_in_mb #55

Open
jop-di opened this issue Jul 13, 2022 · 0 comments

Comments

@jop-di
Copy link

jop-di commented Jul 13, 2022

When a TF file is updated and the update contains changes in a namespace for both backlog_quota.limit_bytes and retention_policies.retention_size_in_mb, the order in which they are updated matters. If the order is incorrect, the update will result in an error. Running the same terraform apply again, results in an OK however.

Pulsar returns an error when you try to configure an backlog quota which exceeds the retention quota(or a retention quota which is lower to the backlog quota):

│ Error: ERROR_UPDATE_NAMESPACE_CONFIG: 1 error occurred:
│ * SetRetention: code: 412 reason: Retention Quota must exceed configured backlog quota for namespace.

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v1.2.2
on linux_amd64

Affected Resource(s)

  • resource_pulsar_namespace.go

Terraform Configuration Files

Configuration file can be copied from example: examples/namespaces/maint.tf (https://github.com/streamnative/terraform-provider-pulsar/blob/master/examples/namespaces/main.tf)

Debug Output

not relevant

Panic Output

not relevant

Expected Behavior

Update both retention quota and backlog quota without error.

Actual Behavior

Error is shown:

│ Error: ERROR_UPDATE_NAMESPACE_CONFIG: 1 error occurred:
│ * SetRetention: code: 412 reason: Retention Quota must exceed configured backlog quota for namespace.

Steps to Reproduce

  1. terraform apply
  2. update the retention quota to exceed the old retention quota and increase the backlog quota to be just below the new retention quota, but above the old retention quota.
  3. terraform apply

Important Factoids

I think somewhere around this line:

if retentionPoliciesConfig.Len() > 0 {
there needs to be a condition:

  • if both retention and backlog limits are updated
    • if retention limit has decreased
      • backlog needs to be updated first!
    • else
      • retention needs to be updated first!
  • else
    • no change compared to current implementation.

References

  • #0000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant