Browse Source
Merge pull request #8559 from smatvienko-tb/hotfix/SqlPartitioningRepository_hotfix_partition_already_pending_detach_in_partitioned_table
[hotfix][3.5.0] SqlPartitioningRepository hotfix: partition already pending detach in partitioned table
pull/8564/head
Andrew Shvayka
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
6 additions and
3 deletions
-
dao/src/main/java/org/thingsboard/server/dao/sqlts/insert/sql/SqlPartitioningRepository.java
|
|
|
@ -110,9 +110,12 @@ public class SqlPartitioningRepository { |
|
|
|
|
|
|
|
String tablePartition = table + "_" + partitionTs; |
|
|
|
String detachPsqlStmtStr = "ALTER TABLE " + table + " DETACH PARTITION " + tablePartition; |
|
|
|
if (getCurrentServerVersion() >= PSQL_VERSION_14) { |
|
|
|
detachPsqlStmtStr += " CONCURRENTLY"; |
|
|
|
} |
|
|
|
|
|
|
|
// hotfix of ERROR: partition "integration_debug_event_1678323600000" already pending detach in partitioned table "public.integration_debug_event"
|
|
|
|
// https://github.com/thingsboard/thingsboard/issues/8271
|
|
|
|
// if (getCurrentServerVersion() >= PSQL_VERSION_14) {
|
|
|
|
// detachPsqlStmtStr += " CONCURRENTLY";
|
|
|
|
// }
|
|
|
|
|
|
|
|
String dropStmtStr = "DROP TABLE " + tablePartition; |
|
|
|
try { |
|
|
|
|