forked from mooncake-track/Mooncake
* [Store] Support degraded startup when master is unavailable Problem: P2P client startup fails when master is unavailable, blocking the entire application. This is problematic for scenarios where the client should be able to start independently and wait for master to become available. Solution: 1. Refactor P2PClientService::Init to support degraded startup: - Try ConnectToMaster/RegisterClient, allow failure - Set HA state to FULL or DEGRADED based on connection result - Skip MountSegment in degraded mode - Heartbeat thread will recover when master becomes available 2. Optimize initialization order: - ConnectToMaster/RegisterClient first - StartHeartbeat before InitTransferEngine (faster heartbeat) - InitTransferEngine and InitStorage after heartbeat starts 3. Add HARecoveryManager::SetState() for setting initial state 4. Make connection_interrupted_ atomic for thread-safe access Changes: - ha_recovery_manager.h: Add SetState() method - client_service.h/cpp: Support degraded startup in heartbeat logic - p2p_client_service.cpp: Refactor Init flow with degraded support Co-Authored-By: Claude (antchat/GLM-5) <noreply@anthropic.com> * [Store] Refactor HA recovery manager and client service 1. Remove unused master_server_entry parameter from ReconnectToMaster. In non-HA mode, current_master_address is already initialized to master_server_entry, making the parameter redundant. 2. Replace SetState() with constructor initial_state parameter. SetState() bypasses the state machine transition logic, which breaks encapsulation. Initial state should only be set during construction. 3. Add WaitForReady() to encapsulate initialization wait logic. Extracts the ready_for_recovery_ and data_manager_ check into a separate method for better readability in RecoveryPipelineMain. Co-Authored-By: Claude (antchat/GLM-5) <noreply@anthropic.com> * [Store] Add TODO comment for race window in segment mount logic Add documentation explaining the race condition between IsDegraded() check and MountSegment() call, and outline future improvement plan to decouple storage layer initialization from master interaction. Co-Authored-By: Claude (antchat/GLM-5) <noreply@anthropic.com> --------- Co-authored-by: wl177541 <wl177541@antgroup.com> Co-authored-by: Claude (antchat/GLM-5) <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| conf | ||
| e2e | ||
| scripts | ||
| utils | ||
| CMakeLists.txt | ||
| allocation_strategy_test.cpp | ||
| ascend_tier_test.cpp | ||
| async_metadata_notifier_test.cpp | ||
| buffer_allocator_test.cpp | ||
| centralized_client_manager_test.cpp | ||
| centralized_client_meta_test.cpp | ||
| centralized_segment_manager_test.cpp | ||
| client_buffer_test.cpp | ||
| client_config_builder_test.cpp | ||
| client_http_metrics_test.cpp | ||
| client_integration_test.cpp | ||
| client_metrics_test.cpp | ||
| client_rpc_service_test.cpp | ||
| data_manager_test.cpp | ||
| distributed_object_store_provider.py | ||
| eviction_strategy_test.cpp | ||
| file_storage_test.cpp | ||
| ha_integration_test.cpp | ||
| ha_recovery_manager_test.cpp | ||
| high_availability_test.cpp | ||
| ipv6_client_test.cpp | ||
| master_metrics_test.cpp | ||
| master_service_ssd_test.cpp | ||
| master_service_test.cpp | ||
| mutex_test.cpp | ||
| non_ha_reconnect_test.cpp | ||
| offset_allocator_test.cpp | ||
| p2p_client_integration_test.cpp | ||
| p2p_client_manager_test.cpp | ||
| p2p_client_meta_test.cpp | ||
| p2p_master_service_test.cpp | ||
| p2p_segment_manager_test.cpp | ||
| peer_client_perf_test.cpp | ||
| peer_client_test.cpp | ||
| posix_file_test.cpp | ||
| pybind_client_test.cpp | ||
| route_cache_test.cpp | ||
| scheduler_integration_test.cpp | ||
| serializer_test.cpp | ||
| storage_backend_test.cpp | ||
| storage_tier_test.cpp | ||
| stress_cluster_benchmark.py | ||
| stress_single_workload_runner.py | ||
| stress_workload_test.cpp | ||
| test_p2p_server_helpers.h | ||
| test_server_helpers.h | ||
| thread_pool_test.cpp | ||
| tiered_backend_test.cpp | ||
| transfer_task_test.cpp | ||
| utils_test.cpp | ||