errose28 commented on a change in pull request #3004:
URL: https://github.com/apache/ozone/pull/3004#discussion_r790047451
##########
File path:
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/ozone/client/rpc/TestOzoneClientSupportedBucketLayouts.java
##########
@@ -0,0 +1,126 @@
+/**
Review comment:
For upgrade integration tests, see `TestOMUpgradeFinalization` for an
example. You probably want something like this:
1. Create a cluster pre-finalized for FSO. You can save on startup time by
omitting datanodes.
`clusterBuilder.setOmLayoutVersion(OMLayoutFeatures.INITIAL_VERSION).withoutDatanodes()`
2. Run your tests on the cluster pre-finalized.
- Make sure all buckets are LEGACY.
3. Finalize the cluster with the client:
`client.finalizeUpgrade()`
- You will need to wait for finalization to complete before proceeding.
See `TestOMUpgradeFinalization#waitForFinalization`. You probably don't care
about the progress messages so you can just wait on the status.
4. Run your tests on the cluster finalized.
- Now there can be FSO or OBS buckets.
You will need to add FSO as a layout feature in `OMLayoutFeature`. I don't
think FSO needs disk format changes at different stages, so just something
following the way INITIAL_VERSION is set up will do.
##########
File path:
hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/OzoneManager.java
##########
@@ -3900,4 +3900,26 @@ private void
updateLayoutVersionInDB(OMLayoutVersionManager lvm,
private BucketLayout getBucketLayout() {
return BucketLayout.DEFAULT;
}
+
+ /**
+ * Get supported Bucket Layouts based on upgrade state.
+ * Before finalization, the method returns an empty list. This leads to the
+ * new client's OzoneClientAdapter and CreateBucketHandler receiving an empty
+ * list - which causes them to continue with LEGACY layout.
+ * After finalization, the method returns a list with the new layouts.
+ *
+ * @return Supported Bucket Layouts.
+ */
+ public List<BucketLayout> getSupportedBucketLayouts() {
+ // Check if we are in Pre-Finalize upgrade state.
+ if (versionManager.getUpgradeState() ==
+ UpgradeFinalizer.Status.FINALIZATION_REQUIRED) {
Review comment:
Add FSO as a layout feature in `OMLayoutFeature`. Then you can call
`OzoneManager#getVersionManager#isAllowed(OMLayoutFeature.FSO)` to determine
whether FSO has been finalized or not.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]