You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 4bc951e
Browse filesBrowse the repository at this point in the historyBrowse files
Enhance migration engine to handle benign skips and update related tests
- Introduced `BenignSkipped` property in `MigrationWriteResult` to track rows that the target would have deleted anyway.
- Updated `MigrationEngine` logic to ensure benign skips do not count towards the halt threshold.
- Added tests to verify that benign skips are handled correctly and do not cause category halts.
- Updated skip reasons to include `PastRetention` for better clarity on skipped rows.
- Created approval files for category selection tests to ensure correct order and configuration.
/// <summary>What the target did with one batch, and the checkpoint it committed alongside the rows. Every skipped row must have a reason in SkipReasons.</summary>
/// <param name="BenignSkipped">How many of Skipped the target would have deleted anyway, such as a row already past retention. Counted and reported like any skip, but never counted toward the halt threshold.</param>
Copy file name to clipboardExpand all lines: src/ServiceControl.Persistence/DataMigration/MigrationEngine.cs
+8-1Lines changed: 8 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -128,8 +128,15 @@ public async Task<MigrationCheckpoint> RunCategoryAsync(MigrationCategory catego
128
128
logger.LogWarning("Skipped {SourceId} in category {CategoryId}",id,category.Id);
129
129
}
130
130
131
+
// A negative fault count would silently disarm the halt threshold for the rest of the run.
132
+
if(result.BenignSkipped>result.Skipped)
133
+
{
134
+
thrownewInvalidOperationException($"The target reported {result.BenignSkipped} benign skips in category {category.Id} out of {result.Skipped} skipped rows. Benign skips are a subset of the skipped rows.");
0 commit comments