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

enable_partitioning not supported servicebus Premium Sku. #1391

Merged
merged 3 commits into from Jul 2, 2018
Merged

enable_partitioning not supported servicebus Premium Sku. #1391

merged 3 commits into from Jul 2, 2018

Conversation

lrxtom2
Copy link
Contributor

@lrxtom2 lrxtom2 commented Jun 14, 2018

According to azure-doc last update, enable_partitioning is not supported in a Premium tier namespace.

reference:
In a Premium tier namespace, partitioning entities is not supported. However, you can still create Service Bus queues and topics in 1, 2, 3, 4, 5, 10, 20, 40, or 80-GB sizes (the default is 1 GB). You can see the size of your queue or topic by looking at its entry on the Azure portal, in the Overview blade for that entity.
https://docs.microsoft.com/en-us/azure/service-bus-messaging/service-bus-partitioning

// We need to retrieve the namespace because Premium namespace works differently from Basic and Standard,
// so it needs different rules applied to it.
namespacesClient := meta.(*ArmClient).serviceBusNamespacesClient
namespace, nsErr := namespacesClient.Get(ctx, resourceGroup, namespaceName)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Super minor, but can we make nsErr just err to keep it consistent in the codebase?

return fmt.Errorf("ServiceBus Queue (%s) must have Partitioning enabled for Premium SKU", name)
// In a Premium tier namespace, partitioning entities is not supported.
if namespace.Sku.Name == servicebus.Premium && d.Get("enable_partitioning").(bool) {
return fmt.Errorf("ServiceBus Queue (%s) does not support Partitioning enabled for Premium SKU", name)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are changing the behavior can we update the documentation too with this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gonna push a commit to remove this, since existing Namespaces should continue working

Copy link
Collaborator

@WodansSon WodansSon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, just needs a few minor tweaks and I think it will be good to go!

Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @lrxtom2,

Thank you for the PR, however I think we need to proceed carefully here. As per the documentation you linked:

Partitioning is available at entity creation for all queues and topics in Basic or Standard SKUs. It is not available for the Premium messaging SKU, but any previously existing partitioned entities in Premium namespaces continue to work as expected.

So it sounds like it used to be only available for premium, and now its available for all tiers except premium. If we do the change as you suggest it could un-partition existing entities. I'm not sure of the best way forward, but we need to make sure we don't force a change upon users who don't want it yet.

So we need to make sure that enable_partitioning can be enabled for premium on import/update/read while only enforcing the condition on create.

In addition we will then need to check on create to make sure we don't upsert over an existing resource (this is something that we need to do anyways, but in this case its extra important)

@tombuildsstuff
Copy link
Member

I'm not sure of the best way forward, but we need to make sure we don't force a change upon users who don't want it yet

@katbyte FWIW we'd tend to normally leave this as a supported property and add a ~> **NOTE:** this is only available for existing accounts

@@ -165,7 +165,7 @@ func TestAccAzureRMServiceBusTopic_enablePartitioningPremium(t *testing.T) {
{
Config: postConfig,
Check: resource.ComposeTestCheckFunc(
resource.TestCheckResourceAttr(resourceName, "enable_partitioning", "true"),
resource.TestCheckResourceAttr(resourceName, "enable_partitioning", "false"),

This comment was marked as outdated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't possible due to the API behaviour change/limitation

@metacpp
Copy link
Contributor

metacpp commented Jun 25, 2018

@lrxtom2 what's user impact if we don't make the fix? Is enable_partitioning still valid for Premium at API level?

@katbyte
Copy link
Collaborator

katbyte commented Jun 25, 2018

@metacpp, @lrxtom2,

An easy fix would be to just allow it for all SKUs, document the limitation and let the API handle the validation.

No longer failing if the sku is premium to allow for existing resources
// In a Premium tier namespace, partitioning entities is not supported.
if namespace.Sku.Name == servicebus.Premium && d.Get("enable_partitioning").(bool) {
return fmt.Errorf("ServiceBus Queue (%s) does not support Partitioning enabled for Premium SKU", name)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gonna push a commit to remove this, since existing Namespaces should continue working

@tombuildsstuff tombuildsstuff dismissed stale reviews from WodansSon and katbyte July 2, 2018 14:03

changes have been pushed

@tombuildsstuff
Copy link
Member

@lrxtom2 so that we can get this merged I've pushed a commit with the comments raised by @katbyte
and @jeffreyCline - I hope you don't mind.

@tombuildsstuff tombuildsstuff added this to the 1.9.0 milestone Jul 2, 2018
Copy link
Collaborator

@katbyte katbyte left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@katbyte katbyte merged commit afbf0a8 into hashicorp:master Jul 2, 2018
katbyte added a commit that referenced this pull request Jul 2, 2018
@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 hashibot-feedback@hashicorp.com. Thanks!

@hashicorp hashicorp locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants