-
Notifications
You must be signed in to change notification settings - Fork 28
async commit + wh #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
async commit + wh #263
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughAdds environment-driven readonly ClickHouse config, a readonly storage connector, and updates handler initialization to select readonly or main storage. Introduces docs and example config. Refactors committer to concurrently publish and commit per batch. Adds a generic NewReadonlyConnector factory and removes an older handler-based storage singleton. Changes
Sequence Diagram(s)sequenceDiagram
participant Client
participant API Handler
participant StorageUtils as storage_utils.getMainStorage
participant Factory as storage.New{Readonly,}Connector
participant CH_RO as ClickHouse Readonly
participant CH_Main as ClickHouse Main
Client->>API Handler: HTTP request
API Handler->>StorageUtils: getMainStorage()
StorageUtils->>StorageUtils: Check Clickhouse.Readonly* config
alt Readonly configured
StorageUtils->>Factory: NewReadonlyConnector(cfg)
Factory->>CH_RO: Connect (readonly)
Factory-->>StorageUtils: readonly storage
else Fallback
StorageUtils->>Factory: NewConnector(cfg)
Factory->>CH_Main: Connect (main)
Factory-->>StorageUtils: main storage
end
API Handler->>StorageUtils: Use storage (reads)
StorageUtils-->>API Handler: Query results
API Handler-->>Client: Response
sequenceDiagram
participant Orchestrator
participant Committer
participant Kafka
participant Storage
Orchestrator->>Committer: Start
loop runCommitLoop (per batch)
Committer->>Committer: Fetch blockDataToCommit
par Publish
Committer->>Kafka: Publish blockDataToCommit
Committer->>Committer: Update lastPublishedBlock
and Commit
Committer->>Storage: Insert/commit blocks
Committer->>Committer: Update metrics
Committer->>Committer: cleanupProcessedStagingBlocks (async)
end
end
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (8)
✨ Finishing Touches
🧪 Generate unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
Summary by CodeRabbit
New Features
Documentation
Refactor