-
Notifications
You must be signed in to change notification settings - Fork 16.3k
Add retry option in RedshiftDeleteClusterOperator to retry when an operation is running in the cluster #27820
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
Conversation
…eration is running in the cluster
| retry: bool = False, | ||
| retry_attempts: int = 10, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if we should just have one tries: int = 1; having two separate arguments for this feels like a potential tripwire.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good idea. The only downside of it is you dont provide a default value in case you want to retry. If you want to retry, you have to come up with a number of retries which can be not very intuitive for users
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need some standardization (see #27276 (comment) )
I think it's better to decide on some standardization and then enforce it across. It's less productive when we discuss this per operator (and also may eventually have different names per operator)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure it is the same use case though. In Syed's PR, the retry logic handles a bug in boto3. Here it handles a valid use case: removing a Redshift cluster that has a running operation. That's why here, in my opinion, we need a flag to whether activate the retry. Some users might want the operator to fail in such scenario, some might want to retry. Regarding the naming, I am happy to rename the parameters to attempts and attempt_interval to make it more consistent across the operators
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless I'm missing something the goal of these parameters from user perspective is to retry without counting this as Airflow retries so I do find this to be the same case (regardless of the reason that this functionality was needed to begin with)
WDYT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are correct but the way I see it is one is a bug fix (through a hack) and one is a feature
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But maybe you are correct and at the end we should enforce the retry because most likely everyone wants to retry if the deletion fails because there is a running operation in the cluster
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should be good now @eladkal
Add retry option in
RedshiftDeleteClusterOperatorto retry when an operation is running in the cluster. When an operation is running in the cluster, the deletion fails and throw an exception like below. This option allows users to retry in such scenario.