Performance improvements and guide update - #20
Merged
Conversation
- (additionally) reduce noise in logs - (additionally) show some love to the CI
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #20 +/- ##
=============================================
+ Coverage 61.21% 74.07% +12.86%
=============================================
Files 25 27 +2
Lines 1748 1809 +61
Branches 200 208 +8
=============================================
+ Hits 1070 1340 +270
+ Misses 597 341 -256
- Partials 81 128 +47
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Revamps the performance/benchmark suite, lands two structural performance improvements to the core locking paths (parallel multi-node I/O and configurable exponential backoff with jitter), brings the documentation back in line with the current API, and streamlines CI. Core code changes are additive and non-breaking.
Core performance
MultiNodeStrategy): acquire/release/extend now fan out per-node Redis operations concurrently viaCompletableFutureon a shared daemon thread pool, waiting for the quorum on join. Per-attempt cost drops from ~N×RTTto ~max(RTT)on multi-node clusters.BackoffCalculator(delay = min(maxRetryDelay, retryDelay × multiplier^attempt), optional jitter), applied inPollingWaitStrategy, theRedlockretry-loop fallback, andRedlockReadWriteLock. Replaces the fixed retry delay that caused contention storms.FairLockintentionally stays on tight polling.RedlockConfigurationaddsmaxRetryDelay,retryDelayMultiplier(≥ 1.0), andretryDelayJitterRatio([0.0, 1.0]), validated. Defaults preserve prior behavior (multiplier 1.0, jitter 0.0).LockWaitStrategy: attempt-awarewaitForRelease(key, timeout, attempt)and a backoff-parameterizedinitialize(...)overload (both default-provided).Benchmarks & tests
JsonReportGeneratoremits machine-readable JSON alongside markdown; per- primitive*-benchmark-results.jsonadded; scenarios/clients and aggregation refactored; newbenchmark-analysis.mdwith methodology and cross-library standings.BackoffCalculatorTest,PollingWaitStrategyTest, and newRedlockConfigurationTestcases.Documentation
index,quick-start,basic-usage,redis-clients,best-practices) off the removed legacynew Redlock(pool…)/redlock.lock(key, ttl)API to theRedlockManagerfactory (withJedis/withLettuce→createLock, JDKLock, try-with-resources on the manager).databasenode option.retryDelay(default 200ms); regenerated stale benchmark tables to match the current results.CountDownLatch.countDownto atomic (decrAndPublishIfZero), fixed signatures, removed leftover fragments.CI
ci.yml: consolidated unit + integration test steps, moved performance tests to-Dgroups=performance, and removed redundant report/code-quality/build-info jobs.pr-validation.ymlworkflow.nightly.yml: dropped a redundant unit-test step.Compatibility
No breaking API changes. New config options are additive; new interface methods have defaults. Behavior is unchanged unless backoff is explicitly configured.