feat(lvol): create volumes with fixed (thick) provisioning by default - #1326
Open
schmidt-scaled wants to merge 3 commits into
Open
schmidt-scaled wants to merge 3 commits into
schmidt-scaled wants to merge 3 commits into
Conversation
bdev_lvol_create was always issued with thin_provision=True, so a volume's clusters were allocated on first write. Create it fixed (thick) instead: the blob's clusters are reserved up front at create time, so the full logical size is committed immediately. Both RPC wrappers change together and must stay in agreement, because a replica / recreate registers the SAME blob its primary created: * create_lvol(..., thin_provision=False) -- the create RPC * bdev_lvol_register(..., thin_provision=False) -- replica / recreate The flag is a parameter (default False) rather than a hard flip, so thin provisioning can still be requested explicitly. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Create volumes with fixed (thick) provisioning instead of thin.
bdev_lvol_createwas always issued withthin_provision=True, so a volume's clusters were allocated lazily on first write. This changes the RPC to allocate the blob's clusters up front at create time, committing the full logical size immediately.Change
Both RPC wrappers in
simplyblock_core/rpc_client.py, together (they must agree — a replica/recreate registers the same blob its primary created):create_lvol(..., thin_provision=False)— thebdev_lvol_createRPCbdev_lvol_register(..., thin_provision=False)— replica / recreate registrationthin_provisionis a parameter (defaultFalse), not a hard flip, so thin can still be requested explicitly per call.Tests
tests/unit/test_lvol_fixed_provisioning.py(6) — create + register default to fixed, both can opt back into thin, defaults agree, no hardcodedTrueremains. Full unit suite 1873 passed / 7 skipped; ruff + mypy clean.For review — please weigh in
This is a blanket behaviour change with real implications; flagging them explicitly rather than assuming:
set_pool/ prov-cap) already account for this, or do they assume thin?create_lvolcaller: base volume create, migration targets (migration_controller,tasks_runner_lvol_migration), and any recreate. Is thick intended for all of those, or only operator-created base volumes? If the latter, the flag should be plumbed from the create API rather than defaulted at the RPC.bdev_lvol_clone/bdev_lvol_snapshot) and are not touched here — a clone stays thin. Is that the intended split, or should clones be thick too?bdev_lvol_registerof an existing blob replays its stored provisioning via blobid).Happy to narrow the scope (e.g. plumb a
--thickflag from the CLI/API through tocreate_lvol) if a blanket default isn't what's wanted.