HDDS-13940. Make OmVolumeArgs owner/timestamps/quotas immutable#9305
HDDS-13940. Make OmVolumeArgs owner/timestamps/quotas immutable#9305adoroszlai merged 6 commits intoapache:masterfrom
Conversation
|
@yandrey321 Can you please take a look at this change |
|
Code change looks fine, I just have a question. OMVolumeArgs, seems to be a kind of persistent object that describes a volume in OM. I cannot see an OMVolumeInfo class. The only place the reference count seems to get incremented and decremented is in OmTenantCreateRequest, which I guess is a rare operation, so performance is likely no concern here. Are we planning to make similar changes to bucket objects too? For example OmBucketInfo, which has |
Yes.
This already exists, because OM creates a copy of By making |
|
Converted to draft because conflicts will need to be resolved after #9327. |
That is very unfortunate. BucketInfo contains these fields: Almost all of these are immutable by definition, but yet a simple increment of usedBytes requires all the fields to be copied again to update the rocksDB. Because omBucketInfo is mutated by every create and delete key, it is heavily mutated. By making it immutable, for every create key, rather than 1 new copy of the original object, we will end up with a builder and then a new copy most likely. It would be nice to split this object in 2, having the immutable fields in one object and the others in a smaller object, but then to write a single increment of usedBytes back to rocksDB, we need to convert the entire object back to proto and write it all back out. I'm not sure how often that happens though, as there is a cache in the picture too. However there is talk of removing the cache, at least for keys. |
That's a good idea. Ideally "usage" should be in a separate table in RocksDB. Created HDDS-13971. |
|
Thanks @sodonnel, @yandrey321 for the review. |
What changes were proposed in this pull request?
Remove mutators for
ownerName,quota*,*Time,refCountfromOmVolumeArgs, make these fieldsfinal.https://issues.apache.org/jira/browse/HDDS-13940
How was this patch tested?
https://github.com/adoroszlai/ozone/actions/runs/19409897987