Skip to contentSkip to conversation

multiple client read/write in cephfs

DISCUSSION 陶冬冬 2 participants 4 messages Oct 23, 2017

lore
Share & tools
lore

陶冬冬

author
#0 lore raw

Dear Cephers,

I have one issue about cephfs, suppose we got below scenario:
client A write one file with interval1 (offset1, length1)
then client B read the same file with interval2 (offset2, length2).
but due to capability system controlled by mds, client B have to wait until client A finish its write operation (including flushing its buffer to osd) Even if interval1 and interval2 belongs to two different object of that file, client B still have to wait client A.

I’m wondering why mds doesn’t try to control the caps based on object rather than whole file?

Thanks,
Dongdong

#1 lore raw
Quoted 6 lines · 陶冬冬

Dear Cephers,

I have one issue about cephfs, suppose we got below scenario:
client A write one file with interval1 (offset1, length1)
then client B read the same file with interval2 (offset2, length2).
but due to capability system controlled by mds, client B have to wait until client A finish its write operation (including flushing its buffer to osd)

Client B only need to wait until Client A finishes flush buffer to osd. If Client B keeps the file descriptor open, writing to page cache gets disabled on client A, reading from client B does not need to wait for writing on client A (different object).

Quoted 3 lines

Even if interval1 and interval2 belongs to two different object of that file, client B still have to wait client A.

I’m wondering why mds doesn’t try to control the caps based on object rather than whole file?

because mds can't foresee which offset client want to read/write. the overhead for issuing caps for each read/write syscall is too high.

Quoted 3 lines

Thanks,
Dongdong

author
#2 lore raw

Thanks Zheng, so, do you mean client B can have “Fs" cap and thle same time client A can have “Fw” for the same file ? so that, client A and client B can write and read the same file at same time (different object) ?

also another extended question, does that mean client A and client B can both have the “Fw” for the same file same time, and also they can write the same file at same time (different object) ?

Dongdong

Quoted 25 lines · Zheng
Quoted 6 lines · 陶冬冬

Dear Cephers,

I have one issue about cephfs, suppose we got below scenario:
client A write one file with interval1 (offset1, length1)
then client B read the same file with interval2 (offset2, length2).
but due to capability system controlled by mds, client B have to wait until client A finish its write operation (including flushing its buffer to osd)

Client B only need to wait until Client A finishes flush buffer to osd. If Client B keeps the file descriptor open, writing to page cache gets disabled on client A, reading from client B does not need to wait for writing on client A (different object).

Quoted 3 lines

Even if interval1 and interval2 belongs to two different object of that file, client B still have to wait client A.

I’m wondering why mds doesn’t try to control the caps based on object rather than whole file?

because mds can't foresee which offset client want to read/write. the overhead for issuing caps for each read/write syscall is too high.

Quoted 3 lines

Thanks,
Dongdong

#3 lore raw
Quoted 4 lines · 陶冬冬

Thanks Zheng, so, do you mean client B can have “Fs" cap and thle same time client A can have “Fw” for the same file ? so that, client A and client B can write and read the same file at same time (different object) ?

Reading within file size only requires "Fr" cap. If read reaches file size and there is no "Fs", checking EOF requires an extra getattr request.

Quoted 32 lines

also another extended question, does that mean client A and client B can both have the “Fw” for the same file same time, and also they can write the same file at same time (different object) ?

Dongdong

Quoted 25 lines · Zheng
Quoted 6 lines · 陶冬冬

Dear Cephers,

I have one issue about cephfs, suppose we got below scenario:
client A write one file with interval1 (offset1, length1)
then client B read the same file with interval2 (offset2, length2).
but due to capability system controlled by mds, client B have to wait until client A finish its write operation (including flushing its buffer to osd)

Client B only need to wait until Client A finishes flush buffer to osd. If Client B keeps the file descriptor open, writing to page cache gets disabled on client A, reading from client B does not need to wait for writing on client A (different object).

Quoted 3 lines

Even if interval1 and interval2 belongs to two different object of that file, client B still have to wait client A.

I’m wondering why mds doesn’t try to control the caps based on object rather than whole file?

because mds can't foresee which offset client want to read/write. the overhead for issuing caps for each read/write syscall is too high.

Quoted 3 lines

Thanks,
Dongdong