Skip to content

Commit

Permalink
fix(operations): Set alter_async=0 when dropping an index asynchronou…
Browse files Browse the repository at this point in the history
…sly (#6237)
  • Loading branch information
phacops authored Aug 22, 2024
1 parent 45fe0c6 commit b96385a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion snuba/migrations/operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ def __init__(
def format_sql(self) -> str:
settings = ""
if self.__run_async:
settings = " SETTINGS mutations_sync=0"
settings = " SETTINGS mutations_sync=0, alter_sync=0"
return f"ALTER TABLE {self.__table_name} DROP INDEX IF EXISTS {self.__index_name}{settings};"

def _block_on_mutations(
Expand Down
2 changes: 1 addition & 1 deletion tests/migrations/test_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ def test_drop_index_async() -> None:
DropIndex(
StorageSetKey.EVENTS, "test_table", "index_1", run_async=True
).format_sql()
== "ALTER TABLE test_table DROP INDEX IF EXISTS index_1 SETTINGS mutations_sync=0;"
== "ALTER TABLE test_table DROP INDEX IF EXISTS index_1 SETTINGS mutations_sync=0, alter_sync=0;"
)


Expand Down

0 comments on commit b96385a

Please sign in to comment.