Closed Bug 2076332 Opened 1 month ago Closed 1 month ago

Only restore a .moz-backup file if it was created during the current run

Categories

(Toolkit :: Application Update, defect)

defect

Tracking

()

RESOLVED FIXED
159 Branch
Tracking Status
firefox-esr153 --- fixed
firefox158 --- fixed
firefox159 --- fixed

People

(Reporter: yannis, Assigned: yannis)

References

(Blocks 1 open bug)

Details

Attachments

(3 external files, 2 obsolete files)

During a non-staged update, we should only restore a .moz-backup file if it was created during the current run. See bug 2076326 for full details on this.

On failure, every action restores the backup of its file whenever one exists,
including the actions that never reached Execute. A backup left behind by an
earlier updater run then puts back an old file next to newer ones. Paths are
tracked rather than actions, because a precomplete remove and the add that
follows it share one backup.

Assignee: nobody → yjuglaret
Status: NEW → ASSIGNED

A non-staged complete update that fails in Draft has not created any backup yet,
while its rollback visits the precomplete removes of every file. Draft writes
only fail on their own in conditions that tests can't easily reproduce, such as
a full disk, so this adds a fault injection to the test updater.

Pushed by yjuglaret@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/c678c950244e https://hg.mozilla.org/integration/autoland/rev/0b9dc405ebe9 Only restore the backups that the current updater run created. r=application-update-reviewers,cdupuis
Status: ASSIGNED → RESOLVED
Closed: 1 month ago
Resolution: --- → FIXED
Target Milestone: --- → 159 Branch

On failure, every action restores the backup of its file whenever one exists,
including the actions that never reached Execute. A backup left behind by an
earlier updater run then puts back an old file next to newer ones. Each action
now only restores the backup it created. The backup that a precomplete remove
shares with the add that follows it is restored by the remove, which rolls back
last.

Original Revision: https://phabricator.services.mozilla.com/D329687

Attachment #9650680 - Flags: approval-mozilla-beta?

firefox-beta Uplift Approval Request

  • User impact if declined/Reason for urgency: The updater can restore files created by previous runs, resulting in corrupt install directories and ultimately startup crashes or startup errors like "Error Platform Version". Possibly worsened by bug 2060275 and bug 2058860.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: medium
  • Explanation of risk level: Simple patch backed by a test, but touches updater code.
  • String changes made/needed?: No
  • Is Android affected?: no

On failure, every action restores the backup of its file whenever one exists,
including the actions that never reached Execute. A backup left behind by an
earlier updater run then puts back an old file next to newer ones. Each action
now only restores the backup it created. The backup that a precomplete remove
shares with the add that follows it is restored by the remove, which rolls back
last.

Original Revision: https://phabricator.services.mozilla.com/D329687

Attachment #9650681 - Flags: approval-mozilla-release?

firefox-release Uplift Approval Request

  • User impact if declined/Reason for urgency: The updater can restore files created by previous runs, resulting in corrupt install directories and ultimately startup crashes or startup errors like "Error Platform Version". Possibly worsened by bug 2060275 and bug 2058860.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: no
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: medium
  • Explanation of risk level: Simple patch backed by a test, but touches updater code.
  • String changes made/needed?: No
  • Is Android affected?: no
Attachment #9650680 - Flags: approval-mozilla-beta? → approval-mozilla-beta+

Comment on attachment 9650681 [details]
Bug 2076332 - Only restore the backups that the current updater run created.

We didn't have updater problems with 157.0 and we are one week away from 158.0, let's have it ride the train and benefit from a week of beta data.

Attachment #9650681 - Flags: approval-mozilla-release? → approval-mozilla-release-
Attachment #9650681 - Attachment is obsolete: true

D329688 adds a test but it didn't get a review in time so didn't land nor get uplifted, so I'll move it to a separate bug to keep things clear.

Blocks: 2078647

Comment on attachment 9649841 [details]
Bug 2076332 - Test that a failure in the Draft phase doesn't restore a leftover backup. r=#application-update-reviewers!

Revision D329688 was moved to bug 2078647. Setting attachment 9649841 [details] to obsolete.

Attachment #9649841 - Attachment is obsolete: true

Does this need an ESR153 uplift?

Flags: needinfo?(yjuglaret)

On failure, every action restores the backup of its file whenever one exists,
including the actions that never reached Execute. A backup left behind by an
earlier updater run then puts back an old file next to newer ones. Each action
now only restores the backup it created. The backup that a precomplete remove
shares with the add that follows it is restored by the remove, which rolls back
last.

Original Revision: https://phabricator.services.mozilla.com/D329687

Attachment #9659217 - Flags: approval-mozilla-esr153?

firefox-esr153 Uplift Approval Request

  • User impact if declined/Reason for urgency: Fixes a source of mismatched-version files in the install directory after a non-staged update. Mismatched-version files are a cause of startup failures and startup crashes where the user has no choice but to reinstall.
  • Code covered by automated testing?: yes
  • Fix verified in Nightly?: yes
  • Needs manual QE testing?: no
  • Steps to reproduce for manual QE testing:
  • Risk associated with taking this patch: low
  • Explanation of risk level: Simple patch backed by a test. Has baked in beta.
  • String changes made/needed?: No
  • Is Android affected?: no
Flags: in-testsuite+
Attachment #9659217 - Flags: approval-mozilla-esr153? → approval-mozilla-esr153+

(In reply to Ryan VanderMeulen [:RyanVM] from comment #13)

Does this need an ESR153 uplift?

(Yes, thanks!)

Flags: needinfo?(yjuglaret)
QA Whiteboard: [qa-triage-done-c161/b160]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: