Skip to content

Conversation

@spetz
Copy link
Contributor

@spetz spetz commented Feb 5, 2026

Connectors runtime lost state on restart - sink connectors resumed from offset 0 instead of their last committed position. The root cause was twofold: consumer group offset queries required membership (which new runtime instances lacked), and stale members from closed TCP connections blocked partition assignment to new members.

Consumer group offset resolution now supports direct queries without membership for ConsumerGroup consumers, since offsets are stored per group+partition, not per member. Stale member cleanup during join removes members whose client connections no longer exist, enabling proper partition rebalancing.

Runtime architecture refactored to fix memory leaks - replaced centralized status manager with DashMap-based SinkManager and SourceManager. Explicit channel cleanup on shutdown prevents dangling references.

State management uses MessagePack serialization for efficient binary persistence. PostgreSQL source fixed to actually return state from poll() and moved database I/O outside mutex to eliminate lock contention.

Additional changes:

  • Replaced chrono with IggyTimestamp across SDK and connectors
  • Added shared API types in sdk/src/api.rs for runtime HTTP API
  • Sink connectors track state, enrich with Iggy metadata, retry transient errors with exponential backoff
  • Comprehensive integration tests for all connector plugins

@spetz spetz added the connectors Connectors runtime label Feb 5, 2026
@spetz spetz requested review from hubcio and mmodzelewski February 5, 2026 11:50
@spetz spetz changed the title feat(connectors): fix state & memory leak, test all plugins, enrich s… feat(connectors): fix state & memory leak, test all plugins, enrich sinks Feb 5, 2026
@spetz spetz added test New testcase, or improvement of existing rust Pull requests that update Rust code labels Feb 5, 2026
@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

❌ Patch coverage is 69.03670% with 135 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.61%. Comparing base (f78a93d) to head (b5aee44).
⚠️ Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
core/connectors/runtime/src/source.rs 24.13% 36 Missing and 8 partials ⚠️
core/connectors/runtime/src/sink.rs 23.68% 24 Missing and 5 partials ⚠️
core/server/src/shard/system/consumer_groups.rs 32.35% 23 Missing ⚠️
core/connectors/sdk/src/api.rs 0.00% 6 Missing ⚠️
core/connectors/sources/postgres_source/src/lib.rs 93.93% 4 Missing and 2 partials ⚠️
core/connectors/sdk/src/transforms/json/mod.rs 37.50% 5 Missing ⚠️
core/server/src/metadata/absorb.rs 66.66% 3 Missing and 1 partial ⚠️
core/common/src/utils/timestamp.rs 50.00% 3 Missing ⚠️
core/connectors/sdk/src/lib.rs 86.95% 2 Missing and 1 partial ⚠️
core/connectors/sdk/src/sink.rs 0.00% 3 Missing ⚠️
... and 6 more
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #2685      +/-   ##
============================================
+ Coverage     67.87%   68.61%   +0.73%     
  Complexity      637      637              
============================================
  Files           734      734              
  Lines         59389    59660     +271     
  Branches      55802    56073     +271     
============================================
+ Hits          40310    40933     +623     
+ Misses        17119    16727     -392     
- Partials       1960     2000      +40     
Flag Coverage Δ
rust 69.79% <69.03%> (+0.78%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
core/connectors/runtime/src/api/mod.rs 50.68% <100.00%> (-1.32%) ⬇️
core/connectors/runtime/src/configs/connectors.rs 28.18% <ø> (ø)
...s/runtime/src/configs/connectors/local_provider.rs 55.24% <ø> (ø)
core/connectors/runtime/src/context.rs 88.09% <ø> (ø)
core/connectors/runtime/src/main.rs 80.59% <100.00%> (+1.73%) ⬆️
core/connectors/runtime/src/manager/sink.rs 63.63% <ø> (+5.45%) ⬆️
core/connectors/runtime/src/manager/source.rs 65.45% <ø> (+7.27%) ⬆️
core/connectors/runtime/src/stats.rs 75.00% <ø> (+22.50%) ⬆️
core/connectors/sdk/src/encoders/proto.rs 71.62% <100.00%> (ø)
...ore/connectors/sinks/elasticsearch_sink/src/lib.rs 70.96% <100.00%> (+70.96%) ⬆️
... and 19 more

... and 20 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

mmodzelewski
mmodzelewski previously approved these changes Feb 5, 2026
@spetz spetz merged commit 0aa1f38 into master Feb 10, 2026
62 checks passed
@spetz spetz deleted the connectors_fix branch February 10, 2026 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

connectors Connectors runtime rust Pull requests that update Rust code test New testcase, or improvement of existing

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants