mirror of
https://github.com/logos-messaging/logos-messaging-nim.git
synced 2026-05-28 21:29:32 +00:00
force FINALIZE partition detach after detecting shorter error (#3728)
This commit is contained in:
parent
8f29070dcf
commit
b38b5aaea1
@ -1347,8 +1347,10 @@ proc removePartition(
|
|||||||
(await self.performWriteQuery(detachPartitionQuery)).isOkOr:
|
(await self.performWriteQuery(detachPartitionQuery)).isOkOr:
|
||||||
info "detected error when trying to detach partition", error
|
info "detected error when trying to detach partition", error
|
||||||
|
|
||||||
if ($error).contains("FINALIZE") or
|
if ($error).contains("FINALIZE") or ($error).contains("already pending"):
|
||||||
($error).contains("already pending detach in part"):
|
## We assume "already pending detach in partitioned table ..." as possible error
|
||||||
|
debug "enforce detach with FINALIZE because of detected error", error
|
||||||
|
|
||||||
## 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