Skip to content

Commit 7e96163

Browse files
RajivTSmeta-codesync[bot]
authored andcommitted
Add Scuba logging to MergeResolutionLostOnRetry invariant
Summary: Add Scuba logging to the fail-closed invariant that detects when merge resolution is lost during CAS retries. The existing ODS counter (`merge_resolution_lost_on_retry`) fires but carries no investigation context. The new Scuba log writes to `mononoke_land_service` with: - `log_tag=MergeResolutionLostOnRetry` for filtering - `repo_name` for identifying the affected repository - `retry_num` for understanding the retry context - A descriptive violation message This enables oncall to quickly investigate invariant violations by querying `mononoke_land_service` with the log_tag filter, rather than relying solely on an ODS counter spike. Note: A separate ODS Alarm should be configured on `mononoke.pushrebase.*.merge_resolution_lost_on_retry` to page the oncall when this invariant fires. Reviewed By: YousefSalama Differential Revision: D99841012 fbshipit-source-id: 74ed319c7e4fb65b6694fa476fd27019af46c20b
1 parent e8216e3 commit 7e96163

File tree

1 file changed

+13
-0
lines changed
  • eden/mononoke/features/pushrebase/src

1 file changed

+13
-0
lines changed

eden/mononoke/features/pushrebase/src/lib.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -910,6 +910,19 @@ async fn rebase_in_loop(
910910
// guards against future logic changes that might break that property.
911911
if any_attempt_resolved_conflicts && merge_resolved_paths.is_none() {
912912
STATS::merge_resolution_lost_on_retry.add_value(1, repo_args.clone());
913+
914+
// Log to Scuba for oncall visibility. The ODS counter alone
915+
// doesn't carry enough context to investigate.
916+
ctx.scuba().clone()
917+
.add("log_tag", "MergeResolutionLostOnRetry")
918+
.add("repo_name", repo.repo_identity().name())
919+
.add("retry_num", retry_num.0 as i64)
920+
.add(
921+
"merge_resolution_invariant_violation",
922+
"any_attempt_resolved_conflicts=true but final attempt has no merge_resolved_paths",
923+
)
924+
.log();
925+
913926
return Err(PushrebaseInternalError::MergeResolutionLostOnRetry.into());
914927
}
915928

0 commit comments

Comments
 (0)