fix: prepare analyzer file resources through streaming client
The Issue & Context
Previously, analyzer file resources were fetched and validated using legacy RPCs and local caching that could cause transient failures, stale resource usage, and lacked robust retry and expiration handling during distributed query execution.
Root Cause Analysis
The old resource loading mechanism did not support batch fetching by resource IDs or names, lacked centralized metadata management, and did not properly coordinate concurrent downloads or handle transient IO errors, leading to inconsistent resource states and validation failures in the coordinator and runners.
Solution Strategy & Architectural Pattern
Introduced a streaming client with a batch FetchFileResources RPC to efficiently retrieve resource metadata and content by IDs or names. The AnalyzerResourceManager centralizes metadata fetching, manages concurrent download flights with shared cancellation, retries transient failures locally, and caches files with TTL-based expiration. Validation is routed through the streaming client to verify resource integrity against fetched metadata, returning precise status errors. Runner lifecycles now pin exact resource bindings, include schema IDs in runner identity, and prepare unavailable runners on demand with retry logic after admission scope release, ensuring consistent resource availability during WAL replay and query execution.
Key Takeaway for Contributors
Centralizing resource metadata management with batch streaming and coordinated concurrent downloads reduces transient failures and stale data issues in distributed systems, while explicit lifecycle and validation integration ensures resource consistency across asynchronous components.