-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HDFS-15624. fix the function of setting quota by storage type #2377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7736e7d
3e62104
0a731cd
fcc143d
113f0de
2d3bb85
edfeec0
d7db1b9
c65741a
5a99d1b
175f33e
2ca2407
847b8f7
769a7c1
92af855
6ba9605
e3eadaa
a88eb6c
56bcbbd
15f0386
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2431,6 +2431,10 @@ private void checkStoragePolicyEnabled(final String operationNameReadable, | |
| * @throws IOException | ||
| */ | ||
| void setStoragePolicy(String src, String policyName) throws IOException { | ||
| if (policyName.equalsIgnoreCase( | ||
| HdfsConstants.ALLNVDIMM_STORAGE_POLICY_NAME)) { | ||
| requireEffectiveLayoutVersionForFeature(Feature.NVDIMM_SUPPORT); | ||
| } | ||
| final String operationName = "setStoragePolicy"; | ||
| checkOperation(OperationCategory.WRITE); | ||
| checkStoragePolicyEnabled("set storage policy", true); | ||
|
|
@@ -3571,6 +3575,9 @@ void setQuota(String src, long nsQuota, long ssQuota, StorageType type) | |
| if (type != null) { | ||
| requireEffectiveLayoutVersionForFeature(Feature.QUOTA_BY_STORAGE_TYPE); | ||
| } | ||
| if (type == StorageType.NVDIMM) { | ||
| requireEffectiveLayoutVersionForFeature(Feature.NVDIMM_SUPPORT); | ||
|
||
| } | ||
|
||
| checkOperation(OperationCategory.WRITE); | ||
| final String operationName = getQuotaCommand(nsQuota, ssQuota); | ||
| final FSPermissionChecker pc = getPermissionChecker(); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because of addition of new STORAGE TYPE,
during upgrade
calls from old clients, who doesnt have this storagetype, will experience failure.
Especially
getQuotaUsage()call will experience failure. May be need to analyze more to avoid failures during upgrade.Even though upgrade is finalized, old clients should continue to work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We add check for setQuota() in FSNamesystem.java, I think it's ok, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
setQuota() check will only block during rollingupgrade. But once its finalized, still old clients experience failure.
Anyway thats the current problem, even before this feature. Can be handled in a separate Jira.
More details about failure: 2.10.1 client asking quota usage from 3.3.0 namenode.
Above issue is coming, because 2.10.1 client doent know about PROVIDED StorageType.
Similar problem will occur for NVDIMM also from previous version clients.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure but will getStoragePolicies also land up in something similar issue? Due to unavailability of storage type? The quota stuff shall be there for PROVIDED also but in case this backward incompatibility is there with Storage Policy too, Then we need to find out some way.
@vinayakumarb do you have pointers or suggestions on this, how to tackle this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have verified the
getStoragePolicies()with older clients.Older clients will get the storage policy but, unknown storage types will be ignored.
So in this case, ALLNVDIMM storage policy shows empty StorageTypes for older clients.
May be need to show DEFAULT StorageType instead of ignoring the unknown StorageTypes. This also can be fixed in a separate Jira. Right now, existing clients wont be broken on
getStoragePolicies()call with this change.So nothing special required for that in this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for clarification and testing.