File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
fluss-server/src/main/java/org/apache/fluss/server/zk Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -222,8 +222,27 @@ public void deleteTableAssignment(long tableId) throws Exception {
222
222
223
223
public void deletePartitionAssignment (long partitionId ) throws Exception {
224
224
String path = PartitionIdZNode .path (partitionId );
225
- zkClient .delete ().deletingChildrenIfNeeded ().forPath (path );
226
- LOG .info ("Deleted table assignment for partition id {}." , partitionId );
225
+ // delete partition assignment ZNode will recursively delete all the children which may
226
+ // block
227
+ // for a long time, so we use background mode here.
228
+ zkClient .delete ()
229
+ .deletingChildrenIfNeeded ()
230
+ .inBackground (
231
+ (client , event ) -> {
232
+ if (event .getResultCode () == KeeperException .Code .OK .intValue ()) {
233
+ LOG .info (
234
+ "Deleted table assignment for partition id {}." ,
235
+ partitionId );
236
+ } else {
237
+ KeeperException .Code code =
238
+ KeeperException .Code .get (event .getResultCode ());
239
+ LOG .error (
240
+ "Failed to delete partition assignment for partition id {}. Error message: {}" ,
241
+ partitionId ,
242
+ code .toString ());
243
+ }
244
+ })
245
+ .forPath (path );
227
246
}
228
247
229
248
// --------------------------------------------------------------------------------------------
You can’t perform that action at this time.
0 commit comments