Repository navigation
[FLINK-38199][benchmark] Add SinkUpsertMaterializerBenchmark for V1 and V2 - #126
MartijnVisser wants to merge 2 commits into
Conversation
Squashed from apache#106 and rebased onto master, with spotless and checkstyle fixes applied.
rkhachatryan
left a comment
There was a problem hiding this comment.
Thanks for resurrecting this :)
I've left some comments, PTAL.
| harness = getHarness(createSum(hasUpsertKey), stateBackend); | ||
| payload = generatePayload(payloadSize); | ||
| numRecordsTotal = RECORDS_PER_INVOCATION; | ||
| retractOffset = (1 + retractDelay) / 2; |
There was a problem hiding this comment.
Older version retracted an element from the middle; new version retracts from the tail.
That eliminates the O(N) list scan when using list-backed state.
There was a problem hiding this comment.
It now retracts the middle row. #106 hit the oldest row too, since retractPercentage 100 skips retractDelay. LEGACY on HEAP without an upsert key at 500 rows drops from 9850 to 2435 ops/ms.
| SequencedMultiSetStateConfig.defaults( | ||
| TimeDomain.PROCESSING_TIME, TTL_CONFIG)); |
There was a problem hiding this comment.
Can we have more cases benchmarked here?
defaults/forValueis a slightly modified V1forMapis a map-based implementationadaptiveis a combination that should be used in Production
There was a problem hiding this comment.
I've added them, configured as StreamExecSink does with the default adaptive thresholds. ADAPTIVE stays on VALUE at 1 row and on MAP at 500. That doubles its nightly time to about 35 minutes.
…re steady state Build the history in the iteration setup and have each invocation insert one row and retract the middle row, so the measured method no longer creates a harness and the history length stays constant. Add the table.exec.sink.upsert-materialize-strategy.type strategies as a parameter and replace retractDelay and retractPercentage with historyLength. Generated-by: Claude Code (Claude Opus 5.5)
9395d53 to
781379b
Compare
Purpose of the change
FLINK-38199 adds a benchmark for the sink upsert materializer. This supersedes #106, which stalled after the review in August 2025. Roman's commit is kept as the first one, formatted for spotless and checkstyle.
Brief change log
SinkUpsertMaterializerBenchmarkwith theflink-table-runtimetest-jar (Roman's commit).table.exec.sink.upsert-materialize-strategy.typestrategies asstrategy,historyLengthinstead ofretractDelayandretractPercentage, and the method renamed tosinkUpsertMaterializerfor codespeed.Verifying this change
Nightly settings (3 forks, 1s iterations), Apple M4 Pro, JDK 17.0.20, Flink 2.5-SNAPSHOT of 2026-10-27:
In a short run with the sink loggers at INFO, no retraction missed its row in any combination.
Impact and documentation
Adds 32 combinations, about 35 minutes in the nightly run.
Was generative AI tooling used to co-author this PR?
Generated-by: Claude Code (Claude Opus 5.5)