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
feat: introduce random sleep before clickhouse loads #4193
feat: introduce random sleep before clickhouse loads #4193
Conversation
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the WalkthroughThe Clickhouse integration code has been updated to include a new feature that introduces a random delay when loading tables. This is achieved by importing the Changes
TipsChat with CodeRabbit Bot (
|
@coderabbitai review |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 2
Configuration used: CodeRabbit UI
Files selected for processing (1)
- warehouse/integrations/clickhouse/clickhouse.go (4 hunks)
Additional comments: 7
warehouse/integrations/clickhouse/clickhouse.go (7)
11-17: The import of "math/rand" is consistent with the PR objective to introduce random sleep delays.
161-165: The addition of the
randomLoadDelay
field to theClickhouse
struct aligns with the PR objective to introduce a random sleep delay before load operations.236-247: The initialization of the
randomLoadDelay
field with a function that calculates a random delay based on configuration parameters is consistent with the PR objective.504-507: The call to
misc.SleepCtx
with therandomLoadDelay
function within theloadTable
method is consistent with the PR objective to introduce a random sleep delay before load operations.246-246: The use of
rand.Float64()
to generate a random delay factor is correct and aligns with the PR objective.504-507: The use of the
randomLoadDelay
function within theloadTable
method to introduce a delay before the load operation is consistent with the PR objective.504-507: The use of
misc.SleepCtx
suggests that the random delay respects the context's deadline or cancellation, which is a good practice for long-running operations.
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #4193 +/- ##
==========================================
- Coverage 72.70% 72.61% -0.09%
==========================================
Files 387 387
Lines 56458 56471 +13
==========================================
- Hits 41048 41009 -39
- Misses 13043 13091 +48
- Partials 2367 2371 +4 ☔ View full report in Codecov by Sentry. |
f06fc0b
to
f1f1183
Compare
Description
Customers facing issues due to continuous inserts on clickhouse. This introduces a
misc.SleepCtx
before every load anywhere between (0, maxDelay] with maxDelay defaulting to 5s.Linear Ticket
Fix Clickhouse "too many parts" errors while inserting data
Security
Summary by CodeRabbit
New Features
Refactor