lgcareer commented on a change in pull request #4164:
URL:
https://github.com/apache/incubator-dolphinscheduler/pull/4164#discussion_r537280017
##########
File path:
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/upgrade/DolphinSchedulerManager.java
##########
@@ -107,23 +107,20 @@ public void upgradeDolphinScheduler() throws Exception{
logger.error("Unable to determine current software version, so
cannot upgrade");
throw new RuntimeException("Unable to determine current
software version, so cannot upgrade");
}
+
// The target version of the upgrade
String schemaVersion = "";
- for(String schemaDir : schemaList) {
- schemaVersion = schemaDir.split("_")[0];
- if(SchemaUtils.isAGreatVersion(schemaVersion , version)) {
- logger.info("upgrade DolphinScheduler metadata version
from {} to {}", version, schemaVersion);
- logger.info("Begin upgrading DolphinScheduler's table
structure");
- upgradeDao.upgradeDolphinScheduler(schemaDir);
- if ("1.3.0".equals(schemaVersion)) {
- upgradeDao.upgradeDolphinSchedulerWorkerGroup();
- } else if ("1.3.2".equals(schemaVersion)) {
- upgradeDao.upgradeDolphinSchedulerResourceList();
- }
- version = schemaVersion;
+ String schemaDir = schemaList.get(schemaList.size() - 1);
+ schemaVersion = schemaDir.split("_")[0];
+ if (SchemaUtils.isAGreatVersion(schemaVersion, version)) {
Review comment:
Hi,Why do you only get the last version?
The design of upgradation is upgrade step by step.
For example,If you want to upgrade 1.2 to 1.3,between 1.2 and 1.3 are
1.2.1,1.2.2.
You must upgreade from 1.2 to 1.2.1,then upgreade from 1.2.1 to 1.2.2.
Of coure if this issue suggest to find the latest image,Now here only havs
one image under the sql/create,you should get the latest image through iterate
over sql/create.
----------------------------------------------------------------
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]