fix: preserve schedule partition keys#17
Merged
Conversation
Recurring schedules already exposed a partition key and the processor forwarded it to jobs, but EF storage did not persist that value on schedule rows. Add schedule partition-key persistence across mappings, provider SQL, and sample migrations so EF-backed schedules can enqueue partitioned jobs after reload. The flaky reader test used a custom reader whose read index was advanced from TryRead, which made the expected retry count timing-dependent. Make the reader deterministically fail through the retry threshold before returning the next job. Constraint: EF upsert SQL is provider-specific and must include the new nullable schedule column for inserts and updates. Rejected: Only patch ScheduleProcessor | processor propagation already existed; EF persistence was the missing path. Confidence: high Scope-risk: moderate Directive: Keep schedule entity, dialect upserts, and sample migration snapshots in sync when adding schedule columns. Tested: dotnet test tests/Atomizer.Tests/Atomizer.Tests.csproj -f net8.0 --filter FullyQualifiedName~ScheduleProcessorTests|FullyQualifiedName~JobWorkerTests.RunAsync_WhenReaderThrowsUnexpected_ShouldLogAndContinueToNextJob Tested: dotnet test tests/Atomizer.EntityFrameworkCore.Tests/Atomizer.EntityFrameworkCore.Tests.csproj -f net8.0 --filter FullyQualifiedName~Providers|FullyQualifiedName~SqliteStorageTestsExecutor.UpsertScheduleAsync Tested: dotnet build Tested: csharpier check . Not-tested: full dotnet test across net6.0 runtime because local machine does not have Microsoft.NETCore.App 6.0 installed
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.
Summary
RunAsync_WhenReaderThrowsUnexpected_ShouldLogAndContinueToNextJobtest with deterministic reader failures.Root cause
Recurring schedule options and the schedule domain model already exposed
PartitionKey, andScheduleProcessoralready forwarded it to generated jobs. EF-backed storage lost the value becauseAtomizerScheduleEntityand its provider upsert SQL did not persist the schedule partition key.