Skip to content

Commit

Permalink
Merge pull request #257 from Aiven-Open/aris-fix-zk-transaction-error
Browse files Browse the repository at this point in the history
Only execute access rights change queries on a single node
  • Loading branch information
Khatskevich authored Nov 7, 2024
2 parents 1ef305c + ded0c15 commit 28484bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions astacus/coordinator/plugins/clickhouse/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,14 +190,14 @@ async def revoke_write_on_table(self, table: Table, user_name: bytes) -> None:
revoke_statement = (
f"REVOKE INSERT, ALTER UPDATE, ALTER DELETE ON {table.escaped_sql_identifier} FROM {escaped_user_name}"
)
await asyncio.gather(*(client.execute(revoke_statement.encode()) for client in self.clients))
await self.clients[0].execute(revoke_statement.encode())

async def grant_write_on_table(self, table: Table, user_name: bytes) -> None:
escaped_user_name = escape_sql_identifier(user_name)
grant_statement = (
f"GRANT INSERT, ALTER UPDATE, ALTER DELETE ON {table.escaped_sql_identifier} TO {escaped_user_name}"
)
await asyncio.gather(*(client.execute(grant_statement.encode()) for client in self.clients))
await self.clients[0].execute(grant_statement.encode())

async def run_step(self, cluster: Cluster, context: StepsContext) -> None:
_, tables = context.get_result(RetrieveDatabasesAndTablesStep)
Expand Down

0 comments on commit 28484bc

Please sign in to comment.