anuragp010 opened a new pull request, #12168:
URL: https://github.com/apache/ozone/pull/12168

   ## What changes were proposed in this pull request?
   # **Conflict**s Resolved:
   
   1. `ContainerBalancerCommands.java`:
   **Conflict**: The first para under description is modified by the master 
whereas the feature branch adds a para immediately after the first para. No 
change made by feature branch to the first para.
   **Resolution**: Accept the master's modification to the first para while 
keeping the newly added para by the feature branch.
   
   2. `ECUnderReplicationHandler.java`:
   **Conflict**: Master removes the import `import 
org.apache.commons.lang3.tuple.Pair;` while feature branch adds the import 
`import org.apache.hadoop.fs.StorageType;` on the line immediately after `Pair`.
   **Resolution**: Remove the import for `Pair` and keep the `StorageType` 
import.
   Occurances: MisReplicationHandlerTests.java, ReplicationManager.java, 
ReplicationTestUtil.java, TestECMisReplicationHandle.java, 
TestECUnderReplicationHandler.java, TestRatisMisReplicationHandler.java, 
TestRatisUnderReplicationHandler.java, TestReplicationManager.java
   
   3. `OMClientProtocol.proto`:
   **Conflict**: Master adds `partIv=26` to the message `KeyArgs` whereas the 
feature branch adds `storagePolicy=26`.
   **Resolution**: Keep `partIv=26` and add `storagePolicy=27`
   
   **Conflict**: Master adds `partIv=10` to the message `KeyLocation` whereas 
the feature branch adds `storagePolicy=10` and `isFallback=11`.
   **Resolution**: Keep `partIv=10` and add `storagePolicy=11`, `isFallback=12`.
   
   **Conflict**: Master adds `partIv=23` to the message `KeyInfo` whereas the 
feature branch adds `storagePolicy=23`.
   **Resolution**: Keep `partIv=23` and add `storagePolicy=24`
   
   4. ContainerStateManagerInvoker.java:
   **Conflict**: Master modifies this generated file while the feature branch 
also modifies this file.
   **Resolution**: Accept master.
   
   5. `OmKeyInfo.java`:
   **Conflict**: `partIv` by master and storage policy related changes by 
feature branch are added on the same lines - the member definition, the 
constructor assignment, getters, builder member definition, 
`builder(OMKeyInfo)` constructor and the setter.
   **Resolution**: First accept the `partIv` changes from master and then the 
storage policy changes from feature branch.
   
   6. `OmKeyLocationInfo.java`:
   **Conflict**: **Conflict**: The `partIv` related changes from master and 
storage policy related changes from feature branch are on the same lines in 
`getProtobuf` and `getFromProtobuf`. The storage policy related changes 
directly attach to the builder.
   **Resolution**: Include the storage policy related changes first as they 
directly attach to the builder chain and then the `partIv` changes from master.
   
   7. `OmKeyRequest.java`:
   **Conflict**: In the 8 arg overload of `allocateBlock`, master adds 
`Preconditions.checkArgument(requestedSize > 0, "requestedSize = %s <= 0", 
requestedSize);` on the same line where feature branch adds 
`Objects.requireNonNull(storagePolicy, "storagePolicy == null");`
   **Resolution**: Keep both imports - master first then `storagePolicy` check.
   
   8. `OMKeyRequestTests.java`:
   **Conflict**: Master adds `import static 
org.junit.jupiter.api.Assertions.assertSame; import static 
org.junit.jupiter.api.Assertions.assertThrows;` on the same line on which the 
feature branch adds `import static org.mockito.ArgumentMatchers.anyBoolean;` .
   **Resolution**: Add the master imports then the feature branch import.
   
   9. `ozone-shell-lib.robot`:
   **Conflict**: [HDDS-17807](https://issues.apache.org/jira/browse/HDDS-17807) 
from master modifies this file to speed up robot tests, while the feature 
branch makes a minor change - the existing test for BucketInfo to container 
`storageType` = `DISK` is updated to `storagePolicy` = `WARM`.
   **Resolution**: Accept all master changes and then make a single change - 
`storageType` to `storagePolicy`. `DISK` to `WARM`.
   
   10. `OzoneKey.java`:
   **Conflict**: `encryptionKeyName` related changes from master are on the 
same lines as `storagePolicy` related changes from the feature branch - the 
member, the getter and in the `fromKeyInfo()` method.
   **Resolution**: Add the `encryptionKeyName` member and getter before the 
`storagePolicy` changes. In `fromKeyInfo()` `storagePolicy` related changes are 
added first as they are directly passed to the constructor unlike 
`encryptionKeyName` which is assigned post creation of the object.
   
   11. `OzoneManagerVersion.java`:
   **Conflict**: Master adds `MULTIPART_PART_IV(105)` and 
`RENAME_KEY_REJECTS_NON_FSO(106)` whereas the feature branch adds 
`STORAGE_POLICY_SUPPORT(105)`.
   **Resolution**: Accept master changes and add `STORAGE_POLICY_SUPPORT(107)`.
   
   12. `RatisPipelineProvider.java`:
   **Conflict**: Master removes import for 
`DatanodeDetails.Port.Name.RATIS_DATASTREAM`, while the feature branch adds 
imports for `HddsProtos.NodeOperationalState.IN_SERVICE` and 
`HddsProtos.NodeState.HEALTHY` in the lines immediately after 
`RATIS_DATASTREAM`.
   **Resolution**: Remove the import for `RATIS_DATASTREAM` and then add the 
imports for `IN_SERVICE` and `HEALTHY`.
   
   **Conflict**: Master removes the import for `java.util.Set` while the 
feature branch adds an import for `StorageType` on the line immediately after.
   **Resolution**: Remove the import for `Set` while adding the `StorageType` 
import.
   
   **Conflict**: Master creates a base class called `NCopyPipelineProvider`. It 
removes `getLeaderChoosePolicy()` and `create(config)` from this class and 
moves it to `NCopyPipelineProvider` whereas the feature branch modifies 
`create(config)` to `create(config, StorageTier)`.
   **Resolution**: Accept master changes and add the `storageTier` to 
`NCopyPipelineProvider.create(config)` as an additional commit.
   
   **Conflict**: Feature branch adds storage tier - `pickNodesNotUsed(config, 
minRatisVolumeSizeBytes, containerSizeBytes, storageTier)` while master changes 
it to `pickNodesNotUsed(config, 
getMinRatisVolumeSizeBytes(),getContainerSizeBytes())`.
   **Resolution**: `pickNodesNotUsed(config, 
getMinRatisVolumeSizeBytes(),getContainerSizeBytes(), storageTier)`
   
   **Conflict**: Feature branch adds storageTier to chooseThreeFactorDatandoes 
- `chooseThreeFactorDatanodes(excl, fav, factor.getNumber(), storageTier)` 
whereas master adds `isRatisStreamingEnabled` - 
`chooseThreeFactorDatanodes(excl, fav, 
factor.getNumber(),isRatisStreamingEnabled)`.
   **Resolution**: `chooseThreeFactorDatanodes(excl, fav, 
factor.getNumber(),isRatisStreamingEnabled, storageTier)`.
   
   **Conflict**: Master replaces the rest of the body of 
`create(RatisReplicationConfig replicationConfig, List<DatanodeDetails> 
excludedNodes, List<DatanodeDetails> favoredNodes)` with just a `return 
createPipeline(RatisReplicationConfig.getInstance(factor), dns);` whereas 
feature branch adds `storageTier` related functionality:
   
   ```java
   List<StorageTier> storageTiers = NodeUtils.getDatanodesStorageTypes(dns, 
getNodeManager());
   if (!storageTiers.contains(storageTier)) {
       throw new SCMException(String.format("Cannot create pipeline for 
StorageTier %s replicationConfig: %s",
               storageTier, replicationConfig), 
SCMException.ResultCodes.FAILED_TO_FIND_SUITABLE_NODE);
   }
   Preconditions.checkArgument(storageTiers.contains(storageTier));
       
   ```
   
   StorageTier is added to the pipelineBuilder
   ```java
   Pipeline pipeline = 
newPipelineBuilder(RatisReplicationConfig.getInstance(factor), dns)
       .setId(PipelineID.randomId())
       .setSuggestedLeaderId(suggestedLeader != null ? suggestedLeader.getID() 
: null)
       .setSupportedStorageTier(storageTier)
       .build();
   ```
   
   And to the log:
   ```java
   dns.forEach(node -> {
       LOG.info("Sending CreatePipelineCommand for pipeline:{} to datanode:{} 
storageTier:{}",
           pipeline.getId(), node, storageTier);
   ```
   **Resolution**: Accept master changes and add the same logic in 
createPipeline method of `NCopyPipelineProvider` in a separate commit. Change 
the createPipeline call to 
`createPipeline(RatisReplicationConfig.getInstance(factor), dns, storageTier);`.
   
   
   **Conflict**: Master removes `create(RatisReplicationConfig 
replicationConfig, List<DatanodeDetails> nodes)` whereas the feature branch 
adds storageTier to the same method and validates the passed storageTier before 
using it in the builder.
   ```java
   public Pipeline create(RatisReplicationConfig replicationConfig,
         List<DatanodeDetails> nodes, StorageTier storageTier) throws 
IOException {
       List<StorageTier> storageTiers = 
NodeUtils.getDatanodesStorageTypes(nodes, getNodeManager());
       if (!storageTiers.contains(storageTier)) {
         throw new SCMException(String.format("Cannot create pipeline for "
                 + "StorageTier %s replicationConfig: %s",
             storageTier, replicationConfig),
             SCMException.ResultCodes.FAILED_TO_FIND_SUITABLE_NODE);
       }
       return newPipelineBuilder(replicationConfig, nodes)
           .setId(PipelineID.randomId())
           .setSupportedStorageTier(storageTier)
           .build();
     }
   ```
   **Resolution**: Accept the master removal of the method and modify the 
corresponing base class method in `NCopyPipelineProvider` in a separate commit.
   
   
   **Conflict**: Master removes 
`chooseThreeFactorDatanodes(List<DatanodeDetails> excludedNodes, 
List<DatanodeDetails> favoredNodes, int requiredNode, StorageTier storageTier)` 
and moves it to `NCopyPipelineProvider`, whereas the feature branch added 
storageTier as an arg and added the following lines:
   ```java
   StorageTierUtil.validateNotEmpty(storageTier);
   final StorageType storageType = storageTier.getUniformStorageType();
   .
   .
   .
   final int count = 
PipelinePlacementPolicy.currentRatisThreePipelineCount(nodeManager, 
stateManager, d, storageType);
   .
   .
   .
   if (additionalExcludedNodes != null) {
       if (excludedNodes != null) {
           additionalExcludedNodes.addAll(excludedNodes);
       }
   try {
           return placementPolicy.chooseDatanodes(additionalExcludedNodes,
           favoredNodes, requiredNode, minRatisVolumeSizeBytes,
           containerSizeBytes, storageType);
       } catch (SCMException scmException) {
           LOG.debug("Failed to allocate datanodes with strict exclusion 
(non-streaming nodes excluded)." +
           " Falling back.", scmException);
       }
   }
   return placementPolicy.chooseDatanodes(excludedNodes,
           favoredNodes, requiredNode, minRatisVolumeSizeBytes,
           containerSizeBytes, storageType);
   
   ```
   **Resolution**: Accept master removal from this file, and as a separate 
commit, add the storagePolicy related changes to the new class - 
`NCopyPipelineProvider`.
   
   13. `ReportPublisher.java`:
   **Conflict**: In `publishReport`, Master adds a for loop to add 
incrementalReports to the `context` whereas the feature branch makes a change 
in the following line to catch  `IllegalArgumentException` apart from 
`IOException`.
   **Resolution**: Keep the newly added for loop by master while also catching 
`IllegalArgumentException` apart from the existing `IOException`.
   
   14. `S3InitiateMultipartUploadRequest.java`:
   **Conflict**: Master wraps `resolvedKeyArgs = resolveBucketAndCheckKeyAcls` 
in a try - catch block whereas the feature branch modified the keyArgs accepted 
to be a builder - `final KeyArgs.Builder resolvedArgsBuilder = 
resolveBucketAndCheckKeyAcls(...).toBuilder()`, then added the storagePolicy 
gate for persistence.
   **Resolution**: Accept the master changes, modify the `resolvedKeyArgs` to 
`final resolvedArgsBuilder` and add the feature branch `storagePolicy` 
persistence gate after the `catch` block.
   
   15. `S3MultipartUploadCompleteRequest.java`:
   **Conflict**: In `getOmKeyInfo` master adds `partsList` as an arg to `final 
String multipartHash = multipartUploadedKeyHash(partKeyInfoMap, partsList);` 
whereas the feature branch adds a comment and sets storage policy during the 
omKeyInfo.toBuilder call in the line immediately after - `builder = 
omKeyInfo.toBuilder().setStoragePolicy(dbOpenKeyInfo.getStoragePolicy());` .
   **Resolution**: Keep the master change and the feature branch comment + 
change.
   
   16. `SCMAdminProtocol.proto`:
   **Conflict**: In the message `SCMContainerLocationRequest` master adds 
`GetExistingContainersInBatchRequestProto getExistingContainersInBatchRequest = 
54;` whereas feature branch adds `ListStorageTypeUsageInfoRequestProto 
listStorageTypeUsageInfoRequestProto = 54;`.
   **Resolution**: Accept master changes as is, then add 
`listStorageTypeUsageInfoRequestProto = 55;`.
   
   **Conflict**: In `ScmContainerLocationResponse` message, master adds 
`GetExistingContainersInBatchResponseProto getExistingContainersInBatchResponse 
= 54;` whereas feature branch adds `ListStorageTypeUsageInfoResponseProto 
listStorageTypeUsageInfoResponseProto = 54;`.
   **Resolution**: Accept master changes as is, then add 
`listStorageTypeUsageInfoResponseProto = 55;`.
   
   **Conflict**: In the enum `Type`, master adds `GetExistingContainersInBatch 
= 50;` and feature branch adds `ListStorageTypeUsageInfo = 50;`
   **Resolution**: Accept master changes as is, then add 
`ListStorageTypeUsageInfo = 51;`.
   
   17. `SCMContainerPlacementRackAware.java`:
   **Conflict**: Master adds import for `java.util.Set` on the same lines as 
feature branch adds `org.apache.hadoop.fs.StorageType;` import.
   **Resolution**: First add import for `Set` and then add import for 
`StorageType`.
   
   **Conflict**: In `chooseDatanodesInternal`, master adds a variable 
unAvailableNodesCount which replaces `excludedNodesCount + usedNodesCount` in 
the following if condition: `if (datanodeCount < nodesRequired + 
excludedNodesCount + usedNodesCount)`. Then master modifies the SCMException 
string to use `unavailableNodesCount` instead of `excludedNodesCount`. Feature 
branch adds `StorageType` to this exception string.
   **Resolution**: Accept master changes and then add `StorageType` passed to 
the resultant exception string.
   
   18. `WriteableRatisContainerProvider.java`:
   **Conflict**: In the `getContainer` method, the feature branch adds 
`storageTier` to the `LOG.error` and then `IOException` message. master 
extracts this message into a single string variable and throws an 
`SCMException` if `missingPipeline !=null` - missingPipeline contains the 
PipelineNotFound exception.
   **Resolution**: Accept master changes and the `storageTier` mentions to 
`Log.error` and the exception message.
   
   19. `TestBlockOutputStreamCorrectness.java`:
   **Conflict**: In `createBlockOutputStream`, master modifies to 
`RatisBlockOutputStream` constructor call to pass `responseExecutor` instead of 
`newFixedThreadPool(10)` whereas the feature branch adds `StorageType.DISK` as 
the last arg.
   **Resolution**: Accept master changes and add `StorageType.DISK` as the last 
arg.
   
   20. `TestContainerBalancerAdvisor.java`:
   **Conflict**: Master adds 
`testComputePerIterationBytesLimitedByEnteringTarget` on the same lines in 
which the feature branch adds 
`testStorageTypesSharePerIterationLimitsDespiteBalancedWholeNodeTotals`.
   **Resolution**: Add both the tests.
   
   21. `TestHealthyPipelineSafeModeRule.java`:
   **Conflict**: Master adds `import 
org.apache.hadoop.hdds.client.ReplicationConfig;` on the same lines where 
feature branch adds `import org.apache.hadoop.hdds.client.StorageTier;`.
   **Resolution**: First add `ReplicationConfig` import and then `StorageTier` 
import.
   
   22. `TestKeyValueHandler.java`:
   **Conflict**: Master adds `import 
org.apache.hadoop.ozone.container.keyvalue.interfaces.BlockManager;` on the 
same line as which feature branch adds `import 
org.apache.hadoop.ozone.container.keyvalue.helpers.BlockUtils;`
   **Resolution**: Add `BlockUtils` import followed by `BlockManager` import.
   
   **Conflict**: Master removes the import for `RandomAccessFileChannel` 
whereas the feature branch adds imports for 
`org.apache.hadoop.hdds.utils.db.StringCodec` and 
`org.apache.hadoop.hdds.utils.db.Table;` on the lines immediately above.
   **Resolution**: Remove `RandomAccessFileChannel` import and keep the feature 
branch imports.
   
   23. `TestOMBucketCreateRequest.java`:
   **Conflict**: Master adds `import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.DeleteBucketRequest;`
 on the same lines on which the feature branch adds `import 
org.apache.hadoop.ozone.protocol.proto.OzoneManagerProtocolProtos.BucketInfo;`.
   **Resolution**: Add the `BucketInfo` import followed by the 
`DeleteBucketRequest` import.
   
   24. `TestOzoneFSInputStream.java`:
   **Conflict**: Master adds `import 
org.apache.hadoop.hdds.protocol.datanode.proto.ContainerProtos;` whereas the 
feature branch removes the `StorageType` import on the line immediately above.
   **Resolution**: Accept the new `ContainerProtos` import and remove the 
`StorageType` import.
   
   25. `TestReconAndAdminContainerCLI.java`:
   **Conflict**: In setupConfigKeys feature branch made changes to fix flaky 
tests - copied from master commit, whereas master modifies this class on top of 
the applied commit,
   **Resolution**: Accept master changes as no StoragePolicy specific changes 
were made to this class.
   
   26. `TestReconAsPassiveScm.java`:
   **Conflict**: Feature branch modified `testDatanodeRegistrationAndReports` 
to wait for Datanode Reports before asserting all containers between 
`scmContainerManager` and `reconContainerManager` using `LambdaTestUtils`. The 
same change was added by master but to use `GenericTestUtils`.
   **Resolution**: As this change is not related to StoragePolicy, the master 
changes were used.
   
   27. `TestS3InitiateMultipartUploadRequest.java`:
   **Conflict**: feature branch adds the import `import 
org.apache.hadoop.ozone.om.exceptions.OMException;` whereas master adds imports 
for `OzoneConsts`, `AuditMessage` and `OMAction` on the same lines.
   **Resolution**: Keep all imports - master first then the `OMException` 
import from feature branch.
   
   28. `TestS3MultipartUploadCompleteRequest.java`:
   **Conflict**: Master adds `import 
org.apache.commons.codec.digest.DigestUtils;` on the same line as which feature 
branch adds `import java.util.stream.Stream;`.
   **Resolution**: Keep both imports - `Stream` and then `DigestUtils`.
   
   **Conflict**: Master and feature branch both add import for 
`ParameterizedTest`.
   **Resolution**: Keep a single instance of the import.
   
   29. `TestScmBlockLocationProtocolServerSideTranslatorPB.java`:
   **Conflict**: Master adds import for `OzoneConfiguration` while feature 
branch adds import for `StoragePolicy` on the same lines.
   **Resolution**: Keep both imports - `StoragePolicy` followed by 
`OzoneConfiguration`.
   
   30. `TestSCMClientProtocolServer.java`:
   **Conflict**: Master and feature branch, both add imports for assertThat.
   **Resolution**: Keep a single import.
   
   31. `RpcClient.java`:
   **Conflict**: In createFile master modifies `isSupportedBy` to use 
`getOmVersion()` instead of `omVersion`, whereas feature branch modifies this 
overload to call the newly added options overload.
   **Resolution**: Accept feature branch changes and modify the `omVersion` 
direct usage in createFile .
   
   32. `TestRpcClient.java`:
   **Conflict**: Master adds `testConditionalDeleteOmVersion` on the same lines 
as which the feature branch adds 
`testCreateBucketWithStoragePolicyRequiresSupportedOmVersion`.
   **Resolution**: Add both the tests.
   
   ## What is the link to the Apache JIRA
   https://issues.apache.org/jira/browse/HDDS-16116
   
   ## How was this patch tested?
   CI
   


-- 
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]

Reply via email to