Persist and sweep topk expire tracker rows - #416
Draft
zipdoki wants to merge 3 commits into
Draft
Conversation
Base automatically changed from
feature/per-entity-top-k-agg
to
feature/per-entity-top-k-meta
July 22, 2026 09:44
zipdoki
force-pushed
the
feature/per-entity-top-k-meta
branch
from
July 22, 2026 09:46
bcdb6f6 to
bd16d71
Compare
zipdoki
force-pushed
the
feature/per-entity-top-k-expire
branch
from
July 23, 2026 01:25
4301f7f to
501c31f
Compare
zipdoki
changed the base branch from
feature/per-entity-top-k-meta
to
feature/per-entity-top-k-agg
July 23, 2026 01:25
…op-k-expire # Conflicts: # core/src/main/kotlin/com/kakao/actionbase/core/metadata/common/AggregationConstants.kt # engine/src/main/kotlin/com/kakao/actionbase/engine/service/AggregationService.kt # engine/src/test/kotlin/com/kakao/actionbase/engine/service/AggregationServiceSpec.kt # server/src/main/kotlin/com/kakao/actionbase/server/configuration/GraphConfiguration.kt # server/src/test/kotlin/com/kakao/actionbase/server/api/graph/v3/metadata/MetadataAggControllerE2ETest.kt
…op-k-expire # Conflicts: # engine/src/main/kotlin/com/kakao/actionbase/engine/service/AggregationService.kt
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
Turn topk aggregation into a two-part flow: write an expire tracker row after each score row (when
Topk.expireAfterMillis > 0), and sweep expired rows in bulk via a new endpoint. Together these let downstream jobs re-aggregate stale topk entries without walking the score table itself.Changes
topk.expireafter every successful score write inAggregationService.aggregateTopk, keyed byAggregationConstants.expireSource/expireTarget.AggregationService.expires+POST /graph/v3/aggregations/expire. Items are deduped by(database, table, source)and swept withexpiresAt:lte:max(expiresAt)on theexpires_at_ascindex.source/targeton each expire row so the touch-line CDC can rebuild the topk event viaEdgeAggregationEvent.of(expire).expireSourcetoXXHash32Wrapper+mod 2310so writes land on the intended 2310 partitions.How to Test
./gradlew :engine:test --tests "com.kakao.actionbase.engine.service.AggregationServiceSpec"./gradlew :server:test --tests "com.kakao.actionbase.server.api.graph.v3.metadata.MetadataAggControllerE2ETest"AI Assistance