mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-01-03 22:43:09 +00:00
fix: detach partition (#3535)
* fix to make sure partitions get properly detached
This commit is contained in:
parent
5f9625f332
commit
2936ba838d
@ -1348,7 +1348,10 @@ proc removePartition(
|
|||||||
"ALTER TABLE messages DETACH PARTITION " & partitionName & " CONCURRENTLY;"
|
"ALTER TABLE messages DETACH PARTITION " & partitionName & " CONCURRENTLY;"
|
||||||
debug "removeOldestPartition", query = detachPartitionQuery
|
debug "removeOldestPartition", query = detachPartitionQuery
|
||||||
(await self.performWriteQuery(detachPartitionQuery)).isOkOr:
|
(await self.performWriteQuery(detachPartitionQuery)).isOkOr:
|
||||||
if ($error).contains("FINALIZE"):
|
debug "detected error when trying to detach partition", error
|
||||||
|
|
||||||
|
if ($error).contains("FINALIZE") or
|
||||||
|
($error).contains("already pending detach in part"):
|
||||||
## We assume the database is suggesting to use FINALIZE when detaching a partition
|
## We assume the database is suggesting to use FINALIZE when detaching a partition
|
||||||
let detachPartitionFinalizeQuery =
|
let detachPartitionFinalizeQuery =
|
||||||
"ALTER TABLE messages DETACH PARTITION " & partitionName & " FINALIZE;"
|
"ALTER TABLE messages DETACH PARTITION " & partitionName & " FINALIZE;"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user