Skip to content

Commit b38b5aa

Browse files
force FINALIZE partition detach after detecting shorter error (#3728)
1 parent 8f29070 commit b38b5aa

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

waku/waku_archive/driver/postgres_driver/postgres_driver.nim

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1347,8 +1347,10 @@ proc removePartition(
13471347
(await self.performWriteQuery(detachPartitionQuery)).isOkOr:
13481348
info "detected error when trying to detach partition", error
13491349

1350-
if ($error).contains("FINALIZE") or
1351-
($error).contains("already pending detach in part"):
1350+
if ($error).contains("FINALIZE") or ($error).contains("already pending"):
1351+
## We assume "already pending detach in partitioned table ..." as possible error
1352+
debug "enforce detach with FINALIZE because of detected error", error
1353+
13521354
## We assume the database is suggesting to use FINALIZE when detaching a partition
13531355
let detachPartitionFinalizeQuery =
13541356
"ALTER TABLE messages DETACH PARTITION " & partitionName & " FINALIZE;"

0 commit comments

Comments
 (0)