feat(connectors): store source state on an HTTP state server - #3940
Open
mmodzelewski wants to merge 1 commit into
Open
feat(connectors): store source state on an HTTP state server#3940mmodzelewski wants to merge 1 commit into
mmodzelewski wants to merge 1 commit into
Conversation
Source connectors checkpoint through the file state backend, which
writes one file per source to local disk. That ties a source's
cursor to the node it happens to run on, so replacing the node or
failing over to another runtime instance rewinds the source.
Add a second backend selected by state.storage. The HTTP provider
stores each source at {url}/source_{key} on any HTTP-speaking
store, so cursors outlive the process. Concurrency is optimistic:
reads remember the returned ETag, writes are conditional
(If-Match, or If-None-Match: * before the first write), and each
logical save carries a stable Idempotency-Key so a server that
committed a write but lost the response replays that outcome
instead of failing the retry with a spurious 412.
State failures are now classified in the SDK. 5xx, timeouts and
connect failures retry with backoff and end as TransientState, so
the batch is Nacked and the plugin re-polls. Version conflicts and
revoked authorization are PermanentState and latch the provider,
failing later saves without touching the network: another writer
took over, and retrying would only mask the original error. A
classified failure while loading an enabled source's state aborts
startup instead of minting a failed plugin, because treating it as
"no state" would silently rewind the source.
The file backend stays the default and its unclassified load
errors keep the per-connector failure path, so existing configs
parse and behave as before.
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3940 +/- ##
=============================================
- Coverage 83.87% 68.91% -14.96%
Complexity 1358 1358
=============================================
Files 1212 1213 +1
Lines 166843 141845 -24998
Branches 134306 109430 -24876
=============================================
- Hits 139937 97757 -42180
- Misses 23266 40254 +16988
- Partials 3640 3834 +194
🚀 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.
Source connectors checkpoint through the file state backend, which
writes one file per source to local disk. That ties a source's
cursor to the node it happens to run on, so replacing the node or
failing over to another runtime instance rewinds the source.
Add a second backend selected by state.storage. The HTTP provider
stores each source at {url}/source_{key} on any HTTP-speaking
store, so cursors outlive the process. Concurrency is optimistic:
reads remember the returned ETag, writes are conditional
(If-Match, or If-None-Match: * before the first write), and each
logical save carries a stable Idempotency-Key so a server that
committed a write but lost the response replays that outcome
instead of failing the retry with a spurious 412.
State failures are now classified in the SDK. 5xx, timeouts and
connect failures retry with backoff and end as TransientState, so
the batch is Nacked and the plugin re-polls. Version conflicts and
revoked authorization are PermanentState and latch the provider,
failing later saves without touching the network: another writer
took over, and retrying would only mask the original error. A
classified failure while loading an enabled source's state aborts
startup instead of minting a failed plugin, because treating it as
"no state" would silently rewind the source.
The file backend stays the default and its unclassified load
errors keep the per-connector failure path, so existing configs
parse and behave as before.