Skip to content

feat: orchestrator switches to FDv1 fallback on directive#539

Merged
beekld merged 13 commits into
mainfrom
beeklimt/SDK-2379-3
Jun 11, 2026
Merged

feat: orchestrator switches to FDv1 fallback on directive#539
beekld merged 13 commits into
mainfrom
beeklimt/SDK-2379-3

Conversation

@beekld

@beekld beekld commented May 23, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements the FDv1 fallback directive in the FDv2 data system with TTL-based recovery.

  • FDv2SourceResult carries std::optional<FDv1FallbackDirective> with a TTL (default 1h, 0 = indefinite).
  • Sources parse X-LD-FD-Fallback-TTL (header) and protocolFallbackTTL (goodbye).
  • On directive: switch to FDv1 if configured, otherwise disconnect (kInterrupted). Schedule retry after TTL.
  • On TTL elapse: SourceManager::SwitchBackToFDv2() re-enables FDv2 (including previously terminal-error-blocked factories), blocks FDv1, restarts synchronizers.

End-to-end fallback will work once an FDv1 streaming source is wrapped as an IFDv2Synchronizer (#540).

Test plan

  • SourceManager tests cover the new block/unblock semantics
  • Source-level tests cover TTL parsing (HTTP + goodbye), default, malformed
  • Orchestrator tests cover directive flows in initializer/synchronizer paths, TTL elapse rebuild, FDv2 recovery
  • Full server suite green

Note

Medium Risk
Changes core flag-data orchestration and protocol fallback behavior; mis-handling could leave clients on the wrong protocol or retry timing, though behavior is heavily tested.

Overview
Adds server-directed FDv1 fallback for the FDv2 data path: results now carry an optional FDv1FallbackDirective (TTL, default 1h; 0 = stay on FDv1 indefinitely) instead of a boolean flag.

Parsing: Goodbye JSON gains protocolFallbackTTL; polling and streaming read X-LD-FD-Fallback / X-LD-FD-Fallback-TTL, with body/goodbye directives overriding headers.

Orchestration: On directive, SourceManager blocks FDv2 factories and selects an IsFDv1Fallback() synchronizer; missing adapter → kInterrupted without forcing kOff. A cancellable timer calls SwitchBackToFDv2() (re-enabling FDv2 factories blocked for terminal errors) and restarts synchronizers. Destructor/Close() no longer sets status to kOff; retry timers are cancelled on close.

Other: Logging tweaks (initializer/synchronizer start, deduped synchronizer interrupts). Broad unit/orchestrator tests cover TTL parsing, switching, recovery, and edge cases.

Reviewed by Cursor Bugbot for commit 81b1c7f. Bugbot is set up for automated code reviews on this repo. Configure here.

@beekld beekld force-pushed the beeklimt/SDK-2379-2 branch from 1833a9c to d795752 Compare May 28, 2026 18:21
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch from 9f04fa3 to ea3b92b Compare May 28, 2026 18:22
@beekld beekld force-pushed the beeklimt/SDK-2379-2 branch from d795752 to 12b23ec Compare May 28, 2026 20:18
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch from ea3b92b to 142b2ff Compare May 28, 2026 20:19
@beekld beekld force-pushed the beeklimt/SDK-2379-2 branch from 12b23ec to 96a7f5a Compare May 28, 2026 23:22
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch 3 times, most recently from e2824ec to f0b2aab Compare May 29, 2026 00:32
@beekld beekld force-pushed the beeklimt/SDK-2379-2 branch from 762768c to 57d4dfb Compare May 29, 2026 21:12
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch from f0b2aab to f94ce01 Compare May 29, 2026 21:17
@beekld beekld force-pushed the beeklimt/SDK-2379-2 branch from 57d4dfb to c95b74a Compare May 29, 2026 21:18
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch 2 times, most recently from eb28df0 to 3e76ae5 Compare May 29, 2026 21:45
Base automatically changed from beeklimt/SDK-2379-2 to main June 3, 2026 21:37
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch 2 times, most recently from bfe0441 to af660a0 Compare June 4, 2026 21:54
@beekld beekld changed the base branch from main to beeklimt/contract-test-url-encoding June 4, 2026 22:02
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch 2 times, most recently from 18951d8 to 35aa744 Compare June 4, 2026 23:51
@beekld beekld force-pushed the beeklimt/contract-test-url-encoding branch from 1714aee to 3488e09 Compare June 4, 2026 23:51
Base automatically changed from beeklimt/contract-test-url-encoding to main June 5, 2026 17:50
@beekld beekld force-pushed the beeklimt/SDK-2379-3 branch from 35aa744 to 5a2a9bc Compare June 5, 2026 18:07
@beekld beekld marked this pull request as ready for review June 8, 2026 16:57
@beekld beekld requested a review from a team as a code owner June 8, 2026 16:57
Comment thread libs/server-sdk/src/data_systems/fdv2/streaming_synchronizer.cpp
Comment thread libs/server-sdk/src/data_systems/fdv2/fdv2_data_system.cpp

@cursor cursor 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.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 9a93aab. Configure here.

Comment thread libs/server-sdk/src/data_systems/fdv2/fdv2_data_system.cpp
beekld added a commit that referenced this pull request Jun 11, 2026
@beekld beekld merged commit 44f2522 into main Jun 11, 2026
47 checks passed
@beekld beekld deleted the beeklimt/SDK-2379-3 branch June 11, 2026 17:56
@github-actions github-actions Bot mentioned this pull request Jun 11, 2026
beekld added a commit that referenced this pull request Jun 11, 2026
beekld added a commit that referenced this pull request Jun 11, 2026
beekld added a commit that referenced this pull request Jun 11, 2026
beekld pushed a commit that referenced this pull request Jun 29, 2026
🤖 I have created a release *beep* *boop*
---


<details><summary>launchdarkly-cpp-client: 3.11.2</summary>

##
[3.11.2](launchdarkly-cpp-client-v3.11.1...launchdarkly-cpp-client-v3.11.2)
(2026-06-29)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-internal bumped from 0.13.0 to 0.14.0
    * @launchdarkly/cpp-common bumped from 1.11.0 to 1.12.0
    * @launchdarkly/cpp-sse-client bumped from 0.6.1 to 0.7.0
</details>

<details><summary>launchdarkly-cpp-common: 1.12.0</summary>

##
[1.12.0](launchdarkly-cpp-common-v1.11.0...launchdarkly-cpp-common-v1.12.0)
(2026-06-29)


### Features

* expose Big Segments via public Client and Config APIs
([#552](#552))
([c5fd239](c5fd239))
</details>

<details><summary>launchdarkly-cpp-internal: 0.14.0</summary>

##
[0.14.0](launchdarkly-cpp-internal-v0.13.0...launchdarkly-cpp-internal-v0.14.0)
(2026-06-29)


### Features

* add internal BigSegmentStoreWrapper with caching and status polling
([#543](#543))
([47fa5c2](47fa5c2))
* orchestrator switches to FDv1 fallback on directive
([#539](#539))
([44f2522](44f2522))


### Bug Fixes

* FDv2 fixes surfaced by v3 contract test harness
([#547](#547))
([e9c3c04](e9c3c04))
* handle FDv2 intentCode none as listening, reject unknown codes
([#555](#555))
([42e8ecd](42e8ecd))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-common bumped from 1.11.0 to 1.12.0
</details>

<details><summary>launchdarkly-cpp-server: 3.11.0</summary>

##
[3.11.0](launchdarkly-cpp-server-v3.10.1...launchdarkly-cpp-server-v3.11.0)
(2026-06-29)


### Features

* add FDv1AdapterSynchronizer wrapping IDataSynchronizer as
IFDv2Synchronizer
([#540](#540))
([d6368b8](d6368b8))
* add FDv2 configuration builder
([#545](#545))
([43850ce](43850ce))
* add IBigSegmentStore interface + Redis and DynamoDB stores
([#536](#536))
([136aca7](136aca7))
* add internal BigSegmentsBuilder + config struct
([#541](#541))
([3c88c2a](3c88c2a))
* add internal BigSegmentStoreWrapper with caching and status polling
([#543](#543))
([47fa5c2](47fa5c2))
* add server FDv2 data system orchestrator
([#529](#529))
([65e110f](65e110f))
* add X-LaunchDarkly-Instance-Id header to server SDK (SDK-2353)
([#532](#532))
([fd0c761](fd0c761))
* evaluate big segments
([#550](#550))
([505ee46](505ee46))
* expose Big Segments via public Client and Config APIs
([#552](#552))
([c5fd239](c5fd239))
* orchestrator switches to FDv1 fallback on directive
([#539](#539))
([44f2522](44f2522))
* propagate FDv1 fallback directive from FDv2 polling and streaming
sources ([#538](#538))
([edd96fe](edd96fe))


### Bug Fixes

* FDv2 fixes surfaced by v3 contract test harness
([#547](#547))
([e9c3c04](e9c3c04))
* stop accumulating WhenAny continuations on the Conditions aggregate
([#562](#562))
([5f8bf79](5f8bf79))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-internal bumped from 0.13.0 to 0.14.0
    * @launchdarkly/cpp-common bumped from 1.11.0 to 1.12.0
    * @launchdarkly/cpp-sse-client bumped from 0.6.1 to 0.7.0
</details>

<details><summary>launchdarkly-cpp-server-dynamodb-source:
0.2.0</summary>

##
[0.2.0](launchdarkly-cpp-server-dynamodb-source-v0.1.0...launchdarkly-cpp-server-dynamodb-source-v0.2.0)
(2026-06-29)


### Features

* add IBigSegmentStore interface + Redis and DynamoDB stores
([#536](#536))
([136aca7](136aca7))
* add internal BigSegmentStoreWrapper with caching and status polling
([#543](#543))
([47fa5c2](47fa5c2))
* implement DynamoDBDataSource + tests
([#534](#534))
([a0c2790](a0c2790))
* scaffold libs/server-sdk-dynamodb-source
([#533](#533))
([df386c1](df386c1))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-server bumped from 3.10.1 to 3.11.0
</details>

<details><summary>launchdarkly-cpp-server-otel: 0.1.2</summary>

##
[0.1.2](launchdarkly-cpp-server-otel-v0.1.1...launchdarkly-cpp-server-otel-v0.1.2)
(2026-06-29)


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-server bumped from 3.10.1 to 3.11.0
</details>

<details><summary>launchdarkly-cpp-server-redis-source: 2.3.0</summary>

##
[2.3.0](launchdarkly-cpp-server-redis-source-v2.2.2...launchdarkly-cpp-server-redis-source-v2.3.0)
(2026-06-29)


### Features

* add IBigSegmentStore interface + Redis and DynamoDB stores
([#536](#536))
([136aca7](136aca7))
* add internal BigSegmentStoreWrapper with caching and status polling
([#543](#543))
([47fa5c2](47fa5c2))


### Dependencies

* The following workspace dependencies were updated
  * dependencies
    * @launchdarkly/cpp-server bumped from 3.10.1 to 3.11.0
</details>

<details><summary>launchdarkly-cpp-sse-client: 0.7.0</summary>

##
[0.7.0](launchdarkly-cpp-sse-client-v0.6.1...launchdarkly-cpp-sse-client-v0.7.0)
(2026-06-29)


### Features

* propagate FDv1 fallback directive from FDv2 polling and streaming
sources ([#538](#538))
([edd96fe](edd96fe))
</details>

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Low Risk**
> The diff is mechanical versioning and changelog updates only;
functional risk is whatever shipped in prior commits now being tagged,
not new logic in this PR.
> 
> **Overview**
> This PR is a **Release Please** cut that updates
`.release-please-manifest.json`, workspace `package.json` dependency
pins, CMake `VERSION` lines, embedded SDK version strings, version
assertion tests, and **CHANGELOG** entries—no feature or bugfix code
appears in the diff itself.
> 
> The release packages **server SDK 3.11.0** (FDv2 orchestration/config,
FDv1 fallback from streaming/polling, big-segment evaluation and public
APIs, Redis/DynamoDB `IBigSegmentStore`, `X-LaunchDarkly-Instance-Id`),
plus **client 3.11.2** and bumps for **common 1.12.0**, **internal
0.14.0**, **SSE 0.7.0**, **redis-source 2.3.0**, **dynamodb-source
0.2.0**, and **otel 0.1.2**.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
48e3593. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

2 participants