Open Bug 1512750 Opened 6 years ago Updated 1 year ago

Having a marker file before removing files in QuotaManager

Categories

(Core :: Storage: Quota Manager, enhancement, P2)

enhancement

Tracking

()

People

(Reporter: tt, Unassigned)

References

(Depends on 1 open bug, Blocks 1 open bug)

Details

Attachments

(1 file)

Given there is still a sightly chance to fail during removing an origin directory (unexpected thing like OS holds a file in that directory). We should have a token/marker file to indicate whether QuotaManager has removed all the files in the giving directory or not.
On the other hands, if the QuotaManager finds out the marker file in the next operation/initialization, it should complete the rest of removing.
Priority: -- → P2
Blocks: 1432133
No longer blocks: 1432133
Blocks: 1519859

In this bug, we should do:

  • Create a marker file before the deletion and remove it after the deletion if the deletion succeeded.
  • Have a hashtable as an inaccessible list so that we don't need to always check the marker files while accessing an origin.
  • Note: Should have a check in EnsureOriginIsInitialized(). If the storage has initialized, we should check the hashtable. Otherwise, check the file.

Concerns:

  • If the marker file lives in the persistence-type folder (default/permanent/temporary), it means the initialization time might increase, since we need to scan whole the files first and then check if there is an origin directory marked by a marker file.
Assignee: nobody → shes050117
Status: NEW → ASSIGNED

(In reply to Tom Tung [:tt, :ttung] from comment #1)

  • Create a marker file before the deletion and remove it after the deletion if the deletion succeeded.

This would be renaming the .metadata-v2 file before the deletion.
Then, deletion other files.
Finally, remove the renamed metadata file and the origin directory.

This should be easier with/after bug 1593365.

Depends on: 1593365

We currently support clearing of files for specific origin and quota client only, so multiple markers would be needed to do it correctly. Again, I think this will be easier after bug 1593365.

Assignee: ttung → nobody
Status: ASSIGNED → NEW
Assignee: nobody → shes050117
Status: NEW → ASSIGNED
Assignee: shes050117 → nobody
Status: ASSIGNED → NEW
Severity: normal → S3

The following patch is waiting for review from a reviewer who resigned from the review:

ID Title Author Reviewer Status
D36587 Bug 1512750 - Have a marker file in the origin directory before the deletion; tt janv: Resigned from review

:tt, could you please find another reviewer or abandon the patch if it is no longer relevant?

For more information, please visit BugBot documentation.

Flags: needinfo?(shes050117)
Flags: needinfo?(shes050117)
You need to log in before you can comment on or make changes to this bug.