Skip to content

os/bluestore: Make truncate() drop unused allocations - #60158

Merged
ljflores merged 1 commit into
ceph:mainfrom
aclamk:wip-aclamk-bluefs-truncate-allocations
Oct 14, 2024
Merged

ljflores merged 1 commit into
ceph:mainfrom
aclamk:wip-aclamk-bluefs-truncate-allocations

Conversation

@aclamk

@aclamk aclamk commented Oct 7, 2024 •

Copy link
Copy Markdown
Contributor

Now when truncate() drops unused allocations.
Modified Close() in BlueRocksEnv to unconditionally call truncate.

Fixes: https://tracker.ceph.com/issues/68385

Contribution Guidelines

  • To sign and title your commits, please refer to Submitting Patches to Ceph.

  • If you are submitting a fix for a stable branch (e.g. "quincy"), please refer to Submitting Patches to Ceph - Backports for the proper workflow.

  • When filling out the below checklist, you may click boxes directly in the GitHub web UI. When entering or editing the entire PR message in the GitHub web UI editor, you may also select a checklist item by adding an x between the brackets: [x]. Spaces and capitalization matter when checking off items this way.

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
  • jenkins test rook e2e

@aclamk
aclamk requested a review from a team as a code owner October 7, 2024 11:53
@aclamk
aclamk requested a review from ifed01 October 7, 2024 14:09
@aclamk
aclamk marked this pull request as draft October 7, 2024 22:04
@aclamk
aclamk force-pushed the wip-aclamk-bluefs-truncate-allocations branch from ca445c0 to e3d8618 Compare October 8, 2024 12:41
@aclamk
aclamk marked this pull request as ready for review October 8, 2024 13:21
Now when truncate() drops unused allocations.
Modified Close() in BlueRocksEnv to unconditionally call truncate.

Fixes: https://tracker.ceph.com/issues/68385

Signed-off-by: Adam Kupczyk <[email protected]>
@aclamk
aclamk force-pushed the wip-aclamk-bluefs-truncate-allocations branch from e3d8618 to 9fc65f1 Compare October 8, 2024 21:09
@aclamk

aclamk commented Oct 9, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test make check

@aclamk

aclamk commented Oct 9, 2024

Copy link
Copy Markdown
Contributor Author

jenkins test api

@aclamk

aclamk commented Oct 14, 2024

Copy link
Copy Markdown
Contributor Author

Teuthology review checks out:
https://pad.ceph.com/p/akupczyk-teuthology-analysis

@rzarzynski rzarzynski left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Let's bake in main for awhile.

@ljflores
ljflores merged commit 24378a0 into ceph:main Oct 14, 2024
@harshkumarRH

Copy link
Copy Markdown

bluefs stats on a Reef build without the code fix

[root@ceph-53z7-harsh-xobris-node7 ~]# ceph df detail
--- RAW STORAGE ---
CLASS 	SIZE	AVAIL	USED  RAW USED  %RAW USED
hdd	375 GiB  363 GiB  12 GiB	12 GiB   	3.19
TOTAL  375 GiB  363 GiB  12 GiB	12 GiB   	3.19
 
--- POOLS ---
POOL               	ID  PGS   STORED   (DATA)   (OMAP)  OBJECTS 	USED   (DATA)   (OMAP)  %USED  MAX AVAIL  QUOTA OBJECTS  QUOTA BYTES  DIRTY  USED COMPR  UNDER COMPR
device_health_metrics   1	1  	0 B  	0 B  	0 B    	0  	0 B  	0 B  	0 B  	0 	98 GiB        	N/A      	N/A	N/A     	0 B      	0 B
cephfs.cephfs.meta  	2   32  2.3 KiB  2.3 KiB  	0 B   	22   96 KiB   96 KiB  	0 B  	0 	98 GiB        	N/A      	N/A	N/A     	0 B      	0 B
cephfs.cephfs.data  	3   32  	0 B  	0 B  	0 B    	0  	0 B  	0 B  	0 B  	0 	98 GiB        	N/A      	N/A	N/A     	0 B      	0 B
.rgw.root           	4   32  1.4 KiB  1.4 KiB  	0 B    	4   48 KiB   48 KiB  	0 B  	0 	98 GiB        	N/A      	N/A	N/A     	0 B      	0 B
default.rgw.log     	5   32  3.6 KiB  3.6 KiB  	0 B  	177  408 KiB  408 KiB  	0 B  	0 	98 GiB        	N/A      	N/A	N/A     	0 B      	0 B
default.rgw.control 	6   32  	0 B  	0 B  	0 B    	8  	0 B  	0 B  	0 B  	0 	98 GiB        	N/A      	N/A	N/A     	0 B      	0 B
default.rgw.meta    	7   32	382 B	382 B  	0 B    	2   24 KiB   24 KiB  	0 B  	0 	98 GiB        	N/A      	N/A	N/A     	0 B      	0 B
test-omap-1         	9	1  3.2 GiB  	0 B  3.2 GiB  	615  9.5 GiB  	0 B  9.5 GiB   3.12 	98 GiB        	N/A      	N/A	N/A     	0 B      	0 B



[ceph: root@ceph-hakumar-oib9my-node3 /]# ceph-bluestore-tool --path /var/lib/ceph/osd/ceph-11 bluefs-stats
1 : device size 0x63fc00000 : using 0x1b0a07000(6.8 GiB)
RocksDBBlueFSVolumeSelector Usage Matrix:
DEV/LEV 	WAL     	DB      	SLOW    	*       	*       	REAL    	FILES  	 
LOG     	0 B     	12 MiB  	0 B     	0 B     	0 B     	11 MiB  	1      	 
WAL     	0 B     	0 B     	0 B     	0 B     	0 B     	0 B     	1      	 
DB      	0 B     	6.7 GiB 	0 B     	0 B     	0 B     	3.3 GiB 	63     	 
SLOW    	0 B     	0 B     	0 B     	0 B     	0 B     	0 B     	0      	 
TOTAL   	0 B     	6.8 GiB 	0 B     	0 B     	0 B     	0 B     	65     	 
MAXIMUMS:
LOG     	0 B     	12 MiB  	0 B     	0 B     	0 B     	11 MiB 	 
WAL     	0 B     	1.3 GiB 	0 B     	0 B     	0 B     	1.0 GiB	 
DB      	0 B     	9.2 GiB 	0 B     	0 B     	0 B     	4.5 GiB	 
SLOW    	0 B     	0 B     	0 B     	0 B     	0 B     	0 B    	 
TOTAL   	0 B     	9.5 GiB 	0 B     	0 B     	0 B     	0 B    	 
>> SIZE <<  0 B     	24 GiB  	0 B

bluefs stats on a Reef build with code fix

[root@ceph-rados-71hotfix-7x8x34-node7 ~]# ceph df detail
--- RAW STORAGE ---
CLASS 	SIZE	AVAIL	USED  RAW USED  %RAW USED
hdd	375 GiB  363 GiB  11 GiB	11 GiB   	3.05
TOTAL  375 GiB  363 GiB  11 GiB	11 GiB   	3.05
 
--- POOLS ---
POOL             	ID  PGS   STORED   (DATA)   (OMAP)  OBJECTS 	USED   (DATA)   (OMAP)  %USED  MAX AVAIL  QUOTA OBJECTS  QUOTA BYTES  DIRTY  USED COMPR  UNDER COMPR
.mgr              	1	1  598 KiB  598 KiB  	0 B    	2  1.8 MiB  1.8 MiB  	0 B  	0	101 GiB        	N/A      	N/A	N/A     	0 B      	0 B
cephfs.cephfs.meta	2   16  3.8 KiB  2.3 KiB  1.5 KiB   	22  100 KiB   96 KiB  4.4 KiB  	0	101 GiB        	N/A      	N/A	N/A     	0 B      	0 B
cephfs.cephfs.data	3  512  	0 B  	0 B  	0 B    	0  	0 B  	0 B  	0 B  	0	101 GiB        	N/A      	N/A	N/A     	0 B      	0 B
.rgw.root         	4   32  2.6 KiB  2.6 KiB  	0 B    	6   72 KiB   72 KiB  	0 B  	0	101 GiB        	N/A      	N/A	N/A     	0 B      	0 B
default.rgw.log   	5   32  3.6 KiB  3.6 KiB  	0 B  	177  408 KiB  408 KiB  	0 B  	0	101 GiB        	N/A      	N/A	N/A     	0 B      	0 B
default.rgw.control   6   32  	0 B  	0 B  	0 B    	8  	0 B  	0 B  	0 B  	0	101 GiB        	N/A      	N/A	N/A     	0 B      	0 B
default.rgw.meta  	7   32	382 B	382 B  	0 B    	3   24 KiB   24 KiB  	0 B  	0	101 GiB        	N/A      	N/A	N/A     	0 B      	0 B
test-omap-1       	8	1  3.2 GiB  	0 B  3.2 GiB  	615  9.5 GiB  	0 B  9.5 GiB   3.05	101 GiB        	N/A      	N/A	N/A     	0 B      	0 B


[ceph: root@ceph-rados-71hotfix-7x8x34-node4 /]# ceph-bluestore-tool --path /var/lib/ceph/osd/ceph-10 bluefs-stats
1 : device size 0x63fc00000 : using 0xd31f2000(3.3 GiB)
RocksDBBlueFSVolumeSelector Usage Matrix:
DEV/LEV 	WAL     	DB      	SLOW    	*       	*       	REAL    	FILES  	 
LOG     	0 B     	16 MiB  	0 B     	0 B     	0 B     	15 MiB  	1      	 
WAL     	0 B     	8.8 MiB 	0 B     	0 B     	0 B     	8.8 MiB 	2      	 
DB      	0 B     	3.3 GiB 	0 B     	0 B     	0 B     	3.3 GiB 	60     	 
SLOW    	0 B     	0 B     	0 B     	0 B     	0 B     	0 B     	0      	 
TOTAL   	0 B     	3.3 GiB 	0 B     	0 B     	0 B     	0 B     	63     	 
MAXIMUMS:
LOG     	0 B     	16 MiB  	0 B     	0 B     	0 B     	15 MiB 	 
WAL     	0 B     	1.1 GiB 	0 B     	0 B     	0 B     	1.0 GiB	 
DB      	0 B     	4.5 GiB 	0 B     	0 B     	0 B     	4.4 GiB	 
SLOW    	0 B     	0 B     	0 B     	0 B     	0 B     	0 B    	 
TOTAL   	0 B     	4.9 GiB 	0 B     	0 B     	0 B     	0 B    	 
>> SIZE <<  0 B     	24 GiB  	0 B

mkogan1 pushed a commit to mkogan1/ceph that referenced this pull request Oct 22, 2024
Now when truncate() drops unused allocations.
Modified Close() in BlueRocksEnv to unconditionally call truncate.

Fixes: https://tracker.ceph.com/issues/68385

Signed-off-by: Adam Kupczyk <[email protected]>
(cherry picked from commit 9fc65f1)
From PR ceph#60158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants