@@ -64,14 +64,6 @@ public function resetWaitForId(): static {
6464 return $ this ;
6565 }
6666
67- /**
68- * Read the wait-for id currently applied to newly added items
69- * @return int
70- */
71- public function getWaitForId (): int {
72- return $ this ->waitForId ;
73- }
74-
7567 /**
7668 * Add new query for requested node to the queue
7769 * @param string $nodeId
@@ -226,14 +218,6 @@ protected function handleQuery(Node $node, array $query): bool {
226218 $ status = $ this ->handleAlterClusterDropTableError ($ query ['query ' ], $ res );
227219 }
228220
229- // Special handling for DELETE CLUSTER: when we proactively clear a node's stale local
230- // copy before re-JOIN, a brand-new node has no such cluster ("unknown cluster"). That
231- // is exactly the desired post-state, not a failure — otherwise the item deadlocks the
232- // JOIN that waits on it.
233- if ($ status === 'error ' && $ this ->isDeleteClusterQuery ($ query ['query ' ])) {
234- $ status = $ this ->handleDeleteClusterError ($ res );
235- }
236-
237221 Buddy::debugvv ("[ {$ node ->id }] Queue query result [ $ status]: " . json_encode ($ res ));
238222
239223 $ duration = (int )((microtime (true ) - $ mt ) * 1000 );
@@ -447,32 +431,6 @@ protected function handleAlterClusterDropTableError(string $query, Struct $error
447431 return 'error ' ;
448432 }
449433
450- /**
451- * Whether the query is a DELETE CLUSTER statement
452- * @param string $query
453- * @return bool
454- */
455- protected function isDeleteClusterQuery (string $ query ): bool {
456- return (bool )preg_match ('/^\s*DELETE\s+CLUSTER\s+/i ' , $ query );
457- }
458-
459- /**
460- * A DELETE CLUSTER that fails because the cluster is not present locally has already
461- * reached its intended state (no stale copy), so treat it as processed.
462- * @param Struct<int|string,mixed> $errorResult
463- * @return string
464- */
465- protected function handleDeleteClusterError (Struct $ errorResult ): string {
466- /** @var array{error?:string}|array{0?:array{error?:string}} $arr */
467- $ arr = $ errorResult ;
468- $ error = (string )($ arr ['error ' ] ?? ($ arr [0 ]['error ' ] ?? '' ));
469- if (stripos ($ error , 'unknown cluster ' ) !== false || stripos ($ error , 'no such cluster ' ) !== false ) {
470- Buddy::debugvv ('DELETE CLUSTER: cluster not present locally, marking as processed ' );
471- return 'processed ' ;
472- }
473- return 'error ' ;
474- }
475-
476434 /**
477435 * Handle error for ALTER CLUSTER ADD TABLE by checking if query is still running
478436 * or if tables are already synced in cluster
0 commit comments