[
https://issues.apache.org/jira/browse/YARN-8298?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16586180#comment-16586180
]
Eric Yang commented on YARN-8298:
---------------------------------
[~csingh] {quote}
Even though the patch 2 referenced resolveCompsDependency, it wasn't being used
to orchestrate upgrade of comp instances in any way.
{quote}
Quote from patch 2:
{code}
+ public int actionUpgradeExpress(Service service) throws YarnException,
+ IOException {
+ int retries = 0;
+ ApplicationReport appReport = upgradePrecheck(service);
+ List<String> components = ServiceApiUtil.resolveCompsDependency(service);
+ LOG.info("Upgrading {} with component list order: {}",
+ service.getName(), components);
+ ClientAMProtocol proxy = createAMProxy(service.getName(), appReport);
+ UpgradeServiceRequestProto.Builder requestBuilder =
+ UpgradeServiceRequestProto.newBuilder();
+ requestBuilder.setVersion(service.getVersion());
+ if (service.getState().equals(ServiceState.UPGRADING_AUTO_FINALIZE)) {
+ requestBuilder.setAutoFinalize(true);
+ }
+ UpgradeServiceResponseProto responseProto = proxy.upgrade(
+ requestBuilder.build());
+ if (responseProto.hasError()) {
+ LOG.error("Service {} upgrade to version {} failed because {}",
+ service.getName(), service.getVersion(), responseProto.getError());
+ throw new YarnException("Failed to upgrade service " + service.getName()
+ + " to version " + service.getVersion() + " because " +
+ responseProto.getError());
+ }
+
+ Service persistedService = getStatus(service.getName());
+ List<Container> containersToUpgrade = null;
+ List<String> containerIdsToUpgrade = new ArrayList<>();
+ // AM cache changes might take a few seconds
+ while (retries < 30) {
+ try {
+ persistedService = getStatus(service.getName());
+ retries++;
+ containersToUpgrade = ServiceApiUtil
+ .validateAndResolveCompsUpgrade(persistedService, components);
+ } catch (YarnException e) {
+ LOG.info("Waiting for service to become ready for upgrade, retries: {}
/ 30", retries);
+ try {
+ Thread.sleep(3000L);
+ } catch (InterruptedException ie) {
+ }
+ }
+ }
+ if (containersToUpgrade == null) {
+ LOG.error("No containers to upgrade.");
+ return EXIT_FALSE;
+ }
+ containersToUpgrade
+ .forEach(compInst -> containerIdsToUpgrade.add(compInst.getId()));
+ LOG.info("instances to upgrade {}", containerIdsToUpgrade);
+ CompInstancesUpgradeRequestProto.Builder upgradeRequestBuilder =
+ CompInstancesUpgradeRequestProto.newBuilder();
+ upgradeRequestBuilder.addAllContainerIds(containerIdsToUpgrade);
+ proxy.upgrade(upgradeRequestBuilder.build());
+ return EXIT_SUCCESS;
+ }
{code}
actionUpgradeExpress computes components order before calling backend. The
logic is to upgrade component by component. Instance order is irrelevant
within a component in this design. I think this match up fine with how we
upgrade services today in Hadoop software.
> Yarn Service Upgrade: Support express upgrade of a service
> ----------------------------------------------------------
>
> Key: YARN-8298
> URL: https://issues.apache.org/jira/browse/YARN-8298
> Project: Hadoop YARN
> Issue Type: Sub-task
> Affects Versions: 3.1.1
> Reporter: Chandni Singh
> Assignee: Chandni Singh
> Priority: Major
> Attachments: YARN-8298.001.patch, YARN-8298.002.patch,
> YARN-8298.003.patch
>
>
> Currently service upgrade involves 2 steps
> * initiate upgrade by providing new spec
> * trigger upgrade of each instance/component
>
> We need to add the ability to upgrade the service in one shot:
> # Aborting the upgrade will not be supported
> # Upgrade finalization will be done automatically.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]