Skip to content

mds: align quota.max_bytes to 4MB or 4KB#46905

Merged
rishabh-d-dave merged 5 commits intoceph:mainfrom
lxbsz:wip-quota
Mar 31, 2023
Merged

mds: align quota.max_bytes to 4MB or 4KB#46905
rishabh-d-dave merged 5 commits intoceph:mainfrom
lxbsz:wip-quota

Conversation

@lxbsz
Copy link
Member

@lxbsz lxbsz commented Jun 30, 2022

The quota.max_bytes must align to 4MB if it's larger than or equals
to 4MB, or must align to 4KB.

This will make the statfs report correct block size and total blocks,
then the df could show expected capacity.

Signed-off-by: Xiubo Li xiubli@redhat.com

Contribution Guidelines

Checklist

  • Tracker (select at least one)
    • References tracker ticket
    • Very recent bug; references commit where it was introduced
    • New feature (ticket optional)
    • Doc update (no ticket needed)
    • Code cleanup (no ticket needed)
  • Component impact
    • Affects Dashboard, opened tracker ticket
    • Affects Orchestrator, opened tracker ticket
    • No impact that needs to be tracked
  • Documentation (select at least one)
    • Updates relevant documentation
    • No doc update is appropriate
  • Tests (select at least one)
Show available Jenkins commands
  • jenkins retest this please
  • jenkins test classic perf
  • jenkins test crimson perf
  • jenkins test signed
  • jenkins test make check
  • jenkins test make check arm64
  • jenkins test submodules
  • jenkins test dashboard
  • jenkins test dashboard cephadm
  • jenkins test api
  • jenkins test docs
  • jenkins render docs
  • jenkins test ceph-volume all
  • jenkins test ceph-volume tox
  • jenkins test windows

@lxbsz lxbsz requested a review from a team June 30, 2022 07:21
@github-actions github-actions bot added the cephfs Ceph File System label Jun 30, 2022
@lxbsz lxbsz force-pushed the wip-quota branch 2 times, most recently from dcdc82b to 5b4a51d Compare June 30, 2022 08:24
@lxbsz lxbsz requested a review from a team as a code owner June 30, 2022 08:24
Copy link
Contributor

@kotreshhr kotreshhr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me otherwise.

@lxbsz lxbsz force-pushed the wip-quota branch 2 times, most recently from 1009aa7 to 9300826 Compare July 4, 2022 06:46
@gregsfortytwo
Copy link
Member

@Madhu-1 would this be okay with CSI? It really simplifies our life but I don't know if it'll be okay for users on top of us.

Copy link
Contributor

@vshankar vshankar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@kotreshhr
Copy link
Contributor

@lxbsz What happens to the quota which is already set ?

@lxbsz
Copy link
Member Author

lxbsz commented Jul 12, 2022

@lxbsz What happens to the quota which is already set ?

The size from df output will always be rounded down to 4MB, for example, if you set quota size to any of (4~8)MB, it always show 4MB capacity.

@mchangir
Copy link
Contributor

@lxbsz What happens to the quota which is already set ?

The size from df output will always be rounded down to 4MB, for example, if you set quota size to any of (4~8)MB, it always show 4MB capacity.

If quota is enforced to the exact size that is used when setting the quota, then there should not be any rounding up or down done specifically for df output.
If quota is rounded up to a multiple of 4KB or 4MB at setting time, then there's no special care required for df output.

Proposal:
I think, quota rounding up to a multiple of 4KB at setting time is an optimal solution. We needn't take any special care of the 4MB case. And we should enforce the quota to the exact number of rounded bytes, i.e. the size to the latest 4KB number of blocks.

Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this pull request Jul 12, 2022
Due to the bug in the df stat we need to roundoff
the subvolume size to allign with 4Mib.

Note:- Minimum supported size in cephcsi is 1Mib,
we dont need to take care of Kib.

fixes ceph#3240

More details at ceph/ceph#46905

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this pull request Jul 12, 2022
Due to the bug in the df stat we need to round off
the subvolume size to align with 4Mib.

Note:- Minimum supported size in cephcsi is 1Mib,
we dont need to take care of Kib.

fixes ceph#3240

More details at ceph/ceph#46905

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
@Madhu-1
Copy link
Contributor

Madhu-1 commented Jul 12, 2022

@Madhu-1 would this be okay with CSI? It really simplifies our life but I don't know if it'll be okay for users on top of us.

@gregsfortytwo it should be fine ceph/ceph-csi#3241 should address it.

Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this pull request Jul 13, 2022
Due to the bug in the df stat we need to round off
the subvolume size to align with 4Mib.

Note:- Minimum supported size in cephcsi is 1Mib,
we dont need to take care of Kib.

fixes ceph#3240

More details at ceph/ceph#46905

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
Madhu-1 added a commit to Madhu-1/ceph-csi that referenced this pull request Jul 13, 2022
Due to the bug in the df stat we need to round off
the subvolume size to align with 4Mib.

Note:- Minimum supported size in cephcsi is 1Mib,
we dont need to take care of Kib.

fixes ceph#3240

More details at ceph/ceph#46905

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
mergify bot pushed a commit to ceph/ceph-csi that referenced this pull request Jul 13, 2022
Due to the bug in the df stat we need to round off
the subvolume size to align with 4Mib.

Note:- Minimum supported size in cephcsi is 1Mib,
we dont need to take care of Kib.

fixes #3240

More details at ceph/ceph#46905

Signed-off-by: Madhu Rajanna <madhupr007@gmail.com>
@lxbsz
Copy link
Member Author

lxbsz commented Feb 23, 2023

Rebased it to resolve the conflicts in doc/cephfs/quota.rst.

@github-actions
Copy link

github-actions bot commented Mar 8, 2023

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

lxbsz added 5 commits March 8, 2023 18:56
The quota.max_bytes must be aligned to 4MB if greater than or equal
to 4MB, otherwise must align to 4KB.

This will make the statfs report correct block size and total blocks,
then the `df` could show expected capacity.

Fixes: https://tracker.ceph.com/issues/56397
Signed-off-by: Xiubo Li <xiubli@redhat.com>
For quota size less than 4KB, report the total=used=4KB,free=0
when quota is full and total=free=4KB, used=0 otherwise.

This is from Kotresh's kceph's fix.

Fixes: https://tracker.ceph.com/issues/56397
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Fixes: https://tracker.ceph.com/issues/56397
Signed-off-by: Xiubo Li <xiubli@redhat.com>
Fixes: https://tracker.ceph.com/issues/56397
Signed-off-by: Xiubo Li <xiubli@redhat.com>
@lxbsz
Copy link
Member Author

lxbsz commented Mar 8, 2023

Rebased it to resolve the conflicts in Server.cc

@rishabh-d-dave
Copy link
Contributor

@rishabh-d-dave rishabh-d-dave merged commit 989f7ec into ceph:main Mar 31, 2023
@rishabh-d-dave
Copy link
Contributor

rishabh-d-dave commented Mar 31, 2023

Comment on lines +48 to +51
#define CEPH_4M_BLOCK_SHIFT 22
#define CEPH_4M_BLOCK_SIZE (1 << CEPH_4M_BLOCK_SHIFT) // 4MB
#define CEPH_4K_BLOCK_SHIFT 12
#define CEPH_4K_BLOCK_SIZE (1 << CEPH_4K_BLOCK_SHIFT) // 4KB
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this needs a bit of correction. CEPH_4M_BLOCK_SIZE and CEPH_4K_BLOCK_SIZE are both power of 2. The comment here as well in other places say (M/K)B ( i.e power of 10) but it should be (M/K)iB. Will add this correction in the PR i raise for the affected test cases due to this patch.

cbodley added a commit to cbodley/ceph that referenced this pull request Jul 20, 2023
* use a fixture for setup_test()
* invoke test_cephfs.py with pytest

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 0bd813f)

Conflicts:
	src/test/pybind/test_cephfs.py
		missing ceph#43546
		missing ceph#46905
@vshankar
Copy link
Contributor

@rishabh-d-dave @lxbsz @dparmar18 Is this PR causing issues which is being fixed by #50910? If that is true, then can be revert this change since #50910 is taking time to get reviewed and tested?

@dparmar18
Copy link
Contributor

@rishabh-d-dave @lxbsz @dparmar18 Is this PR causing issues which is being fixed by #50910? If that is true, then can be revert this change since #50910 is taking time to get reviewed and tested?

@vshankar I'm unaware of the issues caused by this PR but #50910 does solve the issues. One thing i'm concerned about reverting this PR is it might break #50910 since xiubo might've edited the code there that was added by this PR and it might be cumbersome to compare and fix the PR. I think we can prioritise that PR to get it merged ASAP. I can go through that PR again and approve it.

@lxbsz
Copy link
Member Author

lxbsz commented Aug 26, 2023

@rishabh-d-dave @lxbsz @dparmar18 Is this PR causing issues which is being fixed by #50910? If that is true, then can be revert this change since #50910 is taking time to get reviewed and tested?

@vshankar @rishabh-d-dave Sorry I missed Rishabh's last comment. I checked those 3 failure, they are not introduce by the pr #50910. They are just other failures that haven't fixed totally.

If except those 3 failures there is no any other issue let's merge #50910 first ? I'd prefer to create a new PR to fix them instead of reverting this PR, I am afraid reverting it will break the third part APP or the upper layer ODF.

@vshankar
Copy link
Contributor

@rishabh-d-dave @lxbsz @dparmar18 Is this PR causing issues which is being fixed by #50910? If that is true, then can be revert this change since #50910 is taking time to get reviewed and tested?

@vshankar @rishabh-d-dave Sorry I missed Rishabh's last comment. I checked those 3 failure, they are not introduce by the pr #50910. They are just other failures that haven't fixed totally.

If except those 3 failures there is no any other issue let's merge #50910 first ? I'd prefer to create a new PR to fix them instead of reverting this PR, I am afraid reverting it will break the third part APP or the upper layer ODF.

ACK. My only concern was that quota related failures are looming around from ~4 months and they seemed to have cropped up around the time this changes got merged. If we can prioritise and get the fixes merged for quota failures, it would be good.

@lxbsz
Copy link
Member Author

lxbsz commented Aug 26, 2023

@rishabh-d-dave @lxbsz @dparmar18 Is this PR causing issues which is being fixed by #50910? If that is true, then can be revert this change since #50910 is taking time to get reviewed and tested?

@vshankar @rishabh-d-dave Sorry I missed Rishabh's last comment. I checked those 3 failure, they are not introduce by the pr #50910. They are just other failures that haven't fixed totally.
If except those 3 failures there is no any other issue let's merge #50910 first ? I'd prefer to create a new PR to fix them instead of reverting this PR, I am afraid reverting it will break the third part APP or the upper layer ODF.

ACK. My only concern was that quota related failures are looming around from ~4 months and they seemed to have cropped up around the time this changes got merged. If we can prioritise and get the fixes merged for quota failures, it would be good.

Okay, sorry I didn't notice that and before I didn't see any report about the test_volume failures. Just raised a new PR to fix the test_volume issue in #53160.

Thanks

@vshankar
Copy link
Contributor

cbodley added a commit to cbodley/ceph that referenced this pull request Jan 4, 2024
* use a fixture for setup_test()
* invoke test_cephfs.py with pytest

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 0bd813f)

Conflicts:
	src/test/pybind/test_cephfs.py
		missing ceph#43546
		missing ceph#46905
cbodley added a commit to cbodley/ceph that referenced this pull request Jan 5, 2024
* use a fixture for setup_test()
* invoke test_cephfs.py with pytest

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 0bd813f)

Conflicts:
	src/test/pybind/test_cephfs.py
		missing ceph#43546
		missing ceph#46905
cbodley added a commit to cbodley/ceph that referenced this pull request Jan 10, 2024
* use a fixture for setup_test()
* invoke test_cephfs.py with pytest

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 0bd813f)

Conflicts:
	src/test/pybind/test_cephfs.py
		missing ceph#43546
		missing ceph#46905
rishabh-d-dave pushed a commit to rishabh-d-dave/ceph that referenced this pull request Jan 29, 2024
* use a fixture for setup_test()
* invoke test_cephfs.py with pytest

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 0bd813f)

Conflicts:
	src/test/pybind/test_cephfs.py
		missing ceph#43546
		missing ceph#46905
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cephfs Ceph File System documentation tests wip-rishabh-testing Rishabh's testing label

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants