Skip to content

Conversation

@vandonr-amz
Copy link
Contributor

@vandonr-amz vandonr-amz commented Jan 31, 2023

this sensor only checks against the "wanted" status, and not other possibly terminal statuses.
So if the cluster takes an unexpected branch and ends up in a semi-terminal state, this is completely invisible, and would only fail with an uninformative timeout after a long time.

The "proper" fix would be to have a list of terminal states to check against, but I don't have enough redshift knowledge to know what's terminal in the long list of possible statuses:

  • available
  • available, prep-for-resize
  • available, resize-cleanup
  • cancelling-resize
  • creating
  • deleting
  • final-snapshot
  • hardware-failure
  • incompatible-hsm
  • incompatible-network
  • incompatible-parameters
  • incompatible-restore
  • modifying
  • paused
  • rebooting
  • renaming
  • resizing
  • rotating-keys
  • storage-full
  • updating-hsm

So I'm taking this poor man's approach that'd at least allow us to get a sense of what happened from looking at the logs.

(also, since the sensor is very generic, I think it'd be super hard to do because storage-full for instance could be terminal in some cases, except if we run a step to free space and are waiting on the cluster leaving that state ? So many possibilities...)

@boring-cyborg boring-cyborg bot added area:providers provider:amazon AWS/Amazon - related issues labels Jan 31, 2023
Copy link
Contributor

@josh-fell josh-fell left a comment

Choose a reason for hiding this comment

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

Trivial update if you want. Otherwise LGTM!

return self.hook.cluster_status(self.cluster_identifier) == self.target_status
current_status = self.hook.cluster_status(self.cluster_identifier)
self.log.info(
"Poked cluster %s for status '%s', found status '%s'",
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"Poked cluster %s for status '%s', found status '%s'",
"Poked cluster %s for status %r, found status %r",

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'd be happy to apply the suggestion, but can you explain why this would be better ? Both being strings, the output would be exactly the same, wouldn't it ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes. Just merely a suggestion for readability and maybe a little future-proofing with all of those statuses if there is some Enum to be created with a nice repr. Certainly isn't a blocking suggestion to use repr or not.

@josh-fell josh-fell merged commit efc8857 into apache:main Feb 1, 2023
@vandonr-amz vandonr-amz deleted the vandonr/nice branch February 1, 2023 16:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants