Skip to content

Stateful history delta implementation changes + testing - #1917

Merged
WhitWaldo merged 2 commits into
masterfrom
stateful-history-delta-tweaks
Sep 26, 2026
Merged

WhitWaldo merged 2 commits into
masterfrom
stateful-history-delta-tweaks

Conversation

@WhitWaldo

Copy link
Copy Markdown
Contributor

Description

Performs a series of changes to the implementation in #1862:

  • Removes the [RequiresDaprHeadFactAttribute] as this functionality is already performed by [MinimumDaprRuntimeFact]
  • Replaced scan-based eviction for dictionary + linked-list LRU (yielding O(1))
  • Throws on invalid instance/byte limits and negative TTL values (0 and null supported)
  • Added more testing:
    • Using actual work-item streams, prove that even if it finishes late, the old stream handler cannot override the current stream's cached history
    • Old tests only validated event counts, new tests assert exact event IDs and checks order of each operation
    • Validated more completion actions: specifically Completed, Failed, Terminated, and ContinuedAsNew proving correct operation
    • Confirms correct use of GetInstanceHistoryAsync and with exactly one history request
    • Cache behavior was only tested sequentially, now proves concurrent execution with Put, Get, Remov, accounting, eviction bounds, and Reset, verifying that count/byte limits remain valid and retired-generation writes cannot repopulate the cache
    • Validates one-entry cache and coordinates two workflows so at least one history is evicted before its next turn. Verifies both complete correctly, receive deltas, and that the worker performs at least one real GetInstanceHistory recovery.

Issue reference

We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.

Please reference the issue this PR will close: #[issue number]

Checklist

Please make sure you've completed the relevant tasks for this PR, out of the following list:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

…ter attribute

Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
Signed-off-by: Whit Waldo <whit.waldo@innovian.net>
@WhitWaldo WhitWaldo added this to the v1.19 milestone Sep 26, 2026
@WhitWaldo WhitWaldo self-assigned this Sep 26, 2026
@WhitWaldo
WhitWaldo requested review from a team as code owners September 26, 2026 03:09
@codecov

codecov Bot commented Sep 26, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.24%. Comparing base (a29edf2) to head (58003da).

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #1917   +/-   ##
=======================================
  Coverage   64.23%   64.24%           
=======================================
  Files         358      358           
  Lines       10506    10506           
  Branches     1256     1256           
=======================================
+ Hits         6749     6750    +1     
  Misses       3422     3422           
+ Partials      335      334    -1     
Flag Coverage Δ
net10.0 64.21% <ø> (+<0.01%) ⬆️

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

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@WhitWaldo

Copy link
Copy Markdown
Contributor Author

Merging although it's possible this will require another fix PR prior to 1.19 - cannot validate as there's no RC for 1.19 yet.

@WhitWaldo
WhitWaldo merged commit dd2d9de into master Sep 26, 2026
860 of 863 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant