Project

General

Profile

Actions

Feature #601

open

mds: order directory commits after rename

Added by Sage Weil over 13 years ago. Updated almost 8 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Correctness/Safety
Target version:
-
% Done:

0%

Source:
Tags:
Backport:
Reviewed:
Affected Versions:
Component(FS):
Labels (FS):
Pull request ID:

Description

When we rename something between directories, we should try to commit the target directory before the source directory. That way, if all goes to hell, we have at worst 2 links to the file instead of 0.

This probably means adding some xlist<CDir*> commit_after list to the CDirs and make commit wait until the others have committed first.

Actions #1

Updated by Sage Weil over 13 years ago

  • Parent task changed from #547 to #86
Actions #2

Updated by Sage Weil over 13 years ago

  • Tracker changed from Tasks to Feature
Actions #3

Updated by Sage Weil over 13 years ago

  • Source changed from 0 to 3
Actions #4

Updated by Sage Weil over 13 years ago

  • Tracker changed from Tasks to Feature
  • Target version changed from 12 to v0.25
  • Parent task deleted (#86)
Actions #5

Updated by Sage Weil over 13 years ago

  • Translation missing: en.field_position set to 5
Actions #6

Updated by Sage Weil over 13 years ago

  • Translation missing: en.field_position deleted (5)
  • Translation missing: en.field_position set to 2
Actions #7

Updated by Sage Weil over 13 years ago

  • Assignee set to Sage Weil
Actions #8

Updated by Sage Weil over 13 years ago

What if another file is renamed in the other direction? Do a partial commit first? Tricky.

Actions #9

Updated by Sage Weil over 13 years ago

  • Translation missing: en.field_position deleted (3)
  • Translation missing: en.field_position set to 1
  • Translation missing: en.field_position changed from 1 to 525
Actions #10

Updated by Sage Weil about 13 years ago

  • Target version changed from v0.25 to v0.26
Actions #11

Updated by Greg Farnum about 13 years ago

  • Assignee changed from Sage Weil to Greg Farnum

I'm going to take a look at this while waiting for data collection to run as I work on #698.

Actions #12

Updated by Sage Weil about 13 years ago

I think this is going to be much ahrder than I originally imagined. For example:

- mv /a/foo /b/foo
- mv /b/bar /a/bar

Which do we write first? We could:
- force dir /b flush in between the renames?
- flush them later, but in multiple stages.... e.g. flush /b/foo, /a/*, /b/bar removal

Actions #13

Updated by Greg Farnum about 13 years ago

I haven't gotten too far into it yet, but my current line of attack is to see how feasible it is to place "holds" on dentries (linked to their parent CDir) which requires that that dentry not be written to disk until another dentry has been written. Then, when a CDir commit occurs, if any dentries have holds, request the blocking dentry get written to disk. Then attempt to write the whole CDir, but if you can't (ie, you have a hold) just commit the blocking dentry. So:
1) mv a/foo -> b/foo
2) a/foo (null dentry, right?) gets hold linked to b/foo
3) mv b/bar -> a/bar
4) b/bar gets hold linked to a/bar
5) commit a comes in
6) a asks b to commit "foo"
7) b commits just "foo" because there is a hold on "bar"
8) a commits
9) commit b comes in
10) b asks a to commit "bar"
11) a commits full dir
12) b commits

There are some obvious options for optimization here, but I think that if this is feasible to get working then any optimizations will be simple add-ons. I haven't dug into the commit code much more than I have previously but I think this should work?

Actions #14

Updated by Greg Farnum about 13 years ago

Err, I guess actually that should read:
8) a commits
9) hold on b/bar gets removed
10) commit b comes in
11) b commits

Or alternatively, depending on data structures in place:
8) a commits
9) commit b comes in
10) b asks a to commit "bar"
11) a says "already committed that dentry at that version!"
12) b commits

Actions #15

Updated by Sage Weil about 13 years ago

  • Translation missing: en.field_position deleted (526)
  • Translation missing: en.field_position set to 1
  • Translation missing: en.field_position changed from 1 to 527
Actions #16

Updated by Sage Weil about 13 years ago

  • Translation missing: en.field_position deleted (531)
  • Translation missing: en.field_position set to 539
Actions #17

Updated by Sage Weil about 13 years ago

  • Target version changed from v0.26 to 12
Actions #18

Updated by Sage Weil almost 13 years ago

  • Translation missing: en.field_position deleted (585)
  • Translation missing: en.field_position set to 602
Actions #19

Updated by Sage Weil almost 13 years ago

  • Target version changed from 12 to 19
Actions #20

Updated by Sage Weil over 12 years ago

  • Target version deleted (19)
Actions #21

Updated by Sage Weil over 11 years ago

  • Project changed from Ceph to CephFS
  • Category deleted (1)
Actions #22

Updated by Sage Weil over 11 years ago

  • Assignee deleted (Greg Farnum)
Actions #23

Updated by Greg Farnum almost 8 years ago

  • Category set to Correctness/Safety
Actions

Also available in: Atom PDF