captainzmc edited a comment on pull request #1677:
URL: https://github.com/apache/ozone/pull/1677#issuecomment-743944374


   > Hi @captainzmc
   > Few questions:
   > 
   > 1. Can we make use of proto default value to -1 for quotaInBytes value in 
proto.
   > 2. So on old buckets, we cannot set quota, as we don't have any info of 
bytesUsed/namespace count, or if it can be set how this will be handled?
   > 3. And how upgrades are handled for quota feature overall, like for older 
volumes and buckets under it?
   
   Thanks for @bharatviswa504’s advices.
   1. Currently, Unsigned field can't have negative default value in proto. If 
we set [default = -1], an error will be compiled.
   For now, we use getQuotaValue(long quota) to handle the default case in 
[RpcClient.](https://github.com/apache/ozone/blob/master/hadoop-ozone/client/src/main/java/org/apache/hadoop/ozone/client/rpc/RpcClient.java#L463).
 
   2. After adding usedByets, the original keys of the old bucket cannot be 
counted, so we can only count the newly written keys. Therefore, we temporarily 
did not recommend old buckets to enable Quota (because their usedByets were 
inaccurate).
   3. For old buckets we do not recommend that quota be enabled, but in order 
not to affect the write, I handle the default at 
[checkBucketQuotaInBytes](https://github.com/apache/ozone/pull/1677/files#diff-2841a017f8d700d802af1b1c49fea9ca281098728796384f5b2e79c23f09ab65R579)
 in this PR.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to