Skip to content

[feat] Make total_storage_size optional to support unlimited storage capacity#130

Merged
ji-huazhong merged 1 commit into
Ascend:mainfrom
huniu20:feat/optional-storage-capacity-limit
Jun 29, 2026
Merged

[feat] Make total_storage_size optional to support unlimited storage capacity#130
ji-huazhong merged 1 commit into
Ascend:mainfrom
huniu20:feat/optional-storage-capacity-limit

Conversation

@huniu20

@huniu20 huniu20 commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Motivation

When the caller does not know the expected data volume at TQ initialization time (e.g. storage is created before the dataset is loaded), there is no reasonable value to set for total_storage_size, and the hard-coded default of may cause ValueError: Storage capacity exceeded errors at runtime.

Solution

Make total_storage_size optional (nullable). When set to null, the capacity check is skipped and storage grows on demand.

Since StorageUnitData uses a dict internally (no pre-allocation), skipping the capacity check has zero performance or memory overhead.

Changes

  • StorageUnitData: storage_sizeOptional[int] (default None)
  • SimpleStorageUnit: storage_unit_sizeOptional[int]
  • simple_storage_bootstrap: handles null gracefully
  • config.yaml: default total_storage_sizenull

Backward Compatibility

Fully backward compatible — passing an explicit integer value still enforces the capacity limit as before.

@ascend-robot

Copy link
Copy Markdown

CLA Signature Pass

huniu20, thanks for your pull request. All authors of the commits have signed the CLA. 👍

@huniu20 huniu20 force-pushed the feat/optional-storage-capacity-limit branch from c67fafe to d5ab107 Compare June 29, 2026 12:47
@ascend-robot

Copy link
Copy Markdown

CLA Signature Pass

huniu20, thanks for your pull request. All authors of the commits have signed the CLA. 👍

@huniu20 huniu20 changed the title feat(storage): make total_storage_size optional for unlimited capacity [feat] Make total_storage_size optional to support unlimited storage capacity Jun 29, 2026
…e capacity

When the caller does not know the expected data volume at TQ initialization
time (e.g. storage is created before the dataset is loaded), there is no
reasonable value to set for total_storage_size, and the hard-coded default
of 100000 may cause 'Storage capacity exceeded' errors at runtime.

This PR makes total_storage_size optional (nullable). When set to null,
the capacity check is skipped and storage grows on demand. Since the
underlying StorageUnitData uses a dict (no pre-allocation), this has
zero performance or memory overhead.

Changes:
- StorageUnitData: storage_size is now Optional[int] (default None)
- SimpleStorageUnit: storage_unit_size is now Optional[int]
- simple_storage_bootstrap: handles null total_storage_size gracefully
- config.yaml: default total_storage_size changed to null

Fully backward compatible — passing an explicit value still enforces the limit.

Signed-off-by: nexhu <nexhu@tencent.com>
@huniu20 huniu20 force-pushed the feat/optional-storage-capacity-limit branch from d5ab107 to af6e786 Compare June 29, 2026 12:52
@ascend-robot

Copy link
Copy Markdown

CLA Signature Pass

huniu20, thanks for your pull request. All authors of the commits have signed the CLA. 👍

@ji-huazhong ji-huazhong merged commit 3a8bc7c into Ascend:main Jun 29, 2026
8 checks passed
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.

3 participants