Skip to content

Support stream scale-to-zero drain - #14

Merged
ghkdqhrbals merged 24 commits into
unstablefrom
feature/coordinator
Jun 7, 2026
Merged

Support stream scale-to-zero drain#14
ghkdqhrbals merged 24 commits into
unstablefrom
feature/coordinator

Conversation

@ghkdqhrbals

Copy link
Copy Markdown
Owner

Summary

  • allow stream scale targets to reach zero and keep producer routing empty while drained
  • block scale-in completion until every Redis consumer group on removed shards reports pending=0 and known lag=0
  • remove obsolete local Redis compose variants and keep pod/stress compose paths documented
  • update PRD, design docs, OpenAPI, and tests for scale-to-zero semantics

Tests

  • ./gradlew :coordinator-server:test --tests '*CoordinatorServiceTest' --tests '*CoordinatorHttpIntegrationTest' --no-daemon
  • python3 .github/scripts/test_docker_distribution.py
  • ./gradlew :coordinator-server:test --no-daemon
  • ./gradlew test --no-daemon

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

✅ Coordinator tests passed

Check Details
Status ✅ Passed
Run attempt 1
Command ./gradlew :coordinator-server:test :coordinator-server:build --rerun-tasks --no-daemon
Result 177 passed, 0 failed, 0 errored, 7 skipped
Reports Workflow run / Coordinator test report
Raw Gradle test report Open Gradle report

Remaining work before public release

  • Cut the first public Docker image release through the manual GHCR workflow.
  • Add a compatibility fixture suite for old metadata JSON and old client coordination versions.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 6b831bcfe8

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +688 to +689
refreshRedisHealthAsync()
return redisHealthCache?.status ?: "UNKNOWN"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Treat cold Redis health as degraded

When Redis health is required and the cache is cold or expired, this now kicks off the ping asynchronously and immediately returns UNKNOWN; health() still maps every value except DOWN to overall UP, so the first readiness/deployment check after startup (or after cache expiry) can report healthy even while Redis is unreachable until the background refresh completes. For the /coord/v1/monitoring/health endpoint used by deployment checks, either wait for the ping on a cold cache or treat UNKNOWN as degraded.

Useful? React with 👍 / 👎.

Comment on lines 2572 to 2574
private fun GroupMetadata.toProducerRoutingResponse(): ProducerRoutingResponse {
val activeShardKeys = streamShardKeys()
val activeShardKeys = if (shardCount > 0) streamShardKeys() else emptyList()
return ProducerRoutingResponse(

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Allow restarted consumers to tolerate zero-shard routing

Emitting shardCount=0 with an empty shard list makes a drained stream's routing view incompatible with the starter: CoordinatorManagedConsumer.validateInitialRouting() calls CoordinatorRoutingMetadataValidator, which still requires metadata.shardCount > 0 and non-empty shards before the consumer is allowed to start. After a scale-to-zero, any autostarting consumer pod for that group that restarts will fail during bean initialization instead of joining and idling with an empty assignment; the consumer-side validation needs to permit zero-shard routing (or skip this producer-routing validation for consumers).

Useful? React with 👍 / 👎.

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Design docs render

  • Source: design-docs
  • Result: Rendered HTML was uploaded as the coordinator-design-docs-html artifact.
  • Publish: Manual only via the Design docs workflow_dispatch run.
  • Links: workflow run

@github-actions

github-actions Bot commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

✅ Coordinator tests passed

Check Details
Status ✅ Passed
Run attempt 1
Command ./gradlew :coordinator-server:test :coordinator-server:build --rerun-tasks --no-daemon
Result 179 passed, 0 failed, 0 errored, 7 skipped
Reports Workflow run / Coordinator test report
Raw Gradle test report Open Gradle report

Remaining work before public release

  • Cut the first public Docker image release through the manual GHCR workflow.
  • Add a compatibility fixture suite for old metadata JSON and old client coordination versions.

@ghkdqhrbals
ghkdqhrbals merged commit b81f938 into unstable Jun 7, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant