retry on zk metadata sync issue (PR 6826)#7280
Conversation
❌ 1 Tests Failed:
View the top 1 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
e532c03 to
87995bf
Compare
kylemumma
left a comment
There was a problem hiding this comment.
seems fine to me, but it does change the behavior of all migrations
| def execute(self) -> None: | ||
| for i in range(30, -1, -1): # wait at most ~30 seconds | ||
| try: | ||
| super().execute() # type: ignore |
There was a problem hiding this comment.
how do you call super.execute when this class doesnt inheret?
There was a problem hiding this comment.
The specific operation classes (e.g. class AddColumn(RetryOnSyncError, SqlOperation)) inherit from both RetryOnSyncError and SqlOperation now. And super uses the mro (method resolution order) to figure out what to method to call
print(AddColumn.mro())
[<class 'snuba.migrations.operations.AddColumn'>, <class 'snuba.migrations.operations.RetryOnSyncError'>, <class 'snuba.migrations.operations.SqlOperation'>, <class 'abc.ABC'>, <class 'object'>]The order is determined by how the class is defined
class AddColumn(RetryOnSyncError, SqlOperation)
The behavior should be quite similar except in the very specific error code that is added in the |
It was incredibly helpful for us at Kubit Cloud when managing multiple instances (both primary and replica) in Kubernetes, especially when dealing with large ClickHouse sizes and heavy loads. We often had to manually fix migrations, even on fresh installs! |
Re-creation of #6826