@@ -278,17 +278,17 @@ The sharding system now includes automatic rollback capabilities for all operati
278278class RollbackMonitoring {
279279 public function getRollbackMetrics(): array {
280280 $queueTable = 'system.sharding_queue';
281-
281+
282282 // Count rollback operations
283283 $result = $this->client->sendRequest("
284- SELECT
284+ SELECT
285285 COUNT(*) as total_operations,
286286 SUM(CASE WHEN rollback_query != '' THEN 1 ELSE 0 END) as rollback_enabled,
287287 COUNT(DISTINCT operation_group) as operation_groups
288288 FROM {$queueTable}
289289 WHERE created_at > " . ((time() - 86400) * 1000) // Last 24 hours
290290 );
291-
291+
292292 return [
293293 'rollback_coverage' => $rollback_enabled / $total_operations * 100,
294294 'operation_groups_24h' => $operation_groups,
@@ -307,18 +307,18 @@ Configure automatic health monitoring and recovery:
307307class HealthMonitoringCron {
308308 public function run(): void {
309309 $monitor = new HealthMonitor($this->client, $this->cluster);
310-
310+
311311 // Perform health check
312312 $health = $monitor->performHealthCheck();
313-
313+
314314 // Log health status
315315 $this->logHealthStatus($health);
316-
316+
317317 // Auto-recovery if needed
318318 if ($health['overall_status'] !== 'healthy') {
319319 $recovery = $monitor->performAutoRecovery();
320320 $this->logRecoveryActions($recovery);
321-
321+
322322 // Alert if recovery failed
323323 if (!empty($recovery['failed_recoveries'])) {
324324 $this->sendAlert('Recovery failed', $recovery['failed_recoveries']);
@@ -340,13 +340,13 @@ class CleanupSchedule {
340340 $cleanup = new CleanupManager($this->client, $this->cluster);
341341 $cleanup->cleanupOrphanedTemporaryClusters();
342342 }
343-
343+
344344 // Run daily
345345 public function dailyCleanup(): void {
346346 $cleanup = new CleanupManager($this->client, $this->cluster);
347347 $cleanup->cleanupFailedOperationGroups();
348348 }
349-
349+
350350 // Run weekly
351351 public function weeklyCleanup(): void {
352352 $cleanup = new CleanupManager($this->client, $this->cluster);
@@ -365,32 +365,32 @@ class RebalancingController {
365365 // Check before maintenance
366366 public function prepareForMaintenance(): void {
367367 $tables = $this->getShardedTables();
368-
368+
369369 foreach ($tables as $tableName) {
370370 $table = new Table($this->client, $this->cluster, $tableName, '', '');
371-
371+
372372 // Stop any running rebalancing
373373 $result = $table->stopRebalancing(true); // Graceful stop
374-
374+
375375 if ($result['status'] === 'stop_requested') {
376376 // Wait for graceful stop
377377 $this->waitForStop($tableName);
378378 }
379379 }
380380 }
381-
381+
382382 // Emergency stop
383383 public function emergencyStop(string $tableName): void {
384384 $table = new Table($this->client, $this->cluster, $tableName, '', '');
385-
385+
386386 // Immediate stop with rollback
387387 $result = $table->stopRebalancing(false);
388-
388+
389389 if ($result['rollback_executed']) {
390390 $this->logEmergencyStop($tableName, $result);
391391 }
392392 }
393-
393+
394394 // Monitor progress
395395 public function monitorProgress(string $tableName): array {
396396 $table = new Table($this->client, $this->cluster, $tableName, '', '');
0 commit comments