You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
expect(parsed_res.error.cause).toContain('config dir upgrade can not be started - expected_hosts missing one or more hosts specified in system.json hosts_data=');
285
+
expect(parsed_res.error.cause).toContain('config dir upgrade can not be started - expected_hosts contains one or more hosts that are not specified in system.json hosts_data=');
286
286
});
287
287
288
-
it('upgrade start - should fail on missing system.json hosts in expected_hosts',async()=>{
288
+
it('upgrade start - should succeed although system.json contains extra hosts than specified in expected_hosts',async()=>{
expect(parsed_res.error.cause).toContain('config dir upgrade can not be started - system.json missing one or more hosts info specified in expected_hosts hosts_data');
expect(parsed_res.error.cause).toContain('config dir upgrade can not be started - system.json missing one or more hosts info specified in expected_hosts hosts_data');
constexpected_err_msg=`config dir upgrade can not be started until all nodes have the expected version=${pkg.version}, host=${hostname} host's current_version=undefined`;
285
+
constexpected_err_msg=`config dir upgrade can not be started until all expected hosts have the expected version=${pkg.version}, host=${hostname} host's current_version=undefined`;
constexpected_err_msg=`config dir upgrade can not be started until all nodes have the expected version=${pkg.version}, host=${hostname} host's current_version=${old_version}`;
293
+
constexpected_err_msg=`config dir upgrade can not be started until all expected hosts have the expected version=${pkg.version}, host=${hostname} host's current_version=${old_version}`;
constexpected_err_msg=`config dir upgrade can not be started until all nodes have the expected version=${pkg.version}, host=${hostname} host's current_version=${newer_version}`;
301
+
constexpected_err_msg=`config dir upgrade can not be started until all expected hosts have the expected version=${pkg.version}, host=${hostname} host's current_version=${newer_version}`;
Copy file name to clipboardExpand all lines: src/upgrade/nc_upgrade_manager.js
+15-13
Original file line number
Diff line number
Diff line change
@@ -154,11 +154,11 @@ class NCUpgradeManager {
154
154
* 2. The user's expected_version is the host's package version -
155
155
* expected_version is the expected source code version that the user asks to upgrade to, it's an optional verification,
156
156
* if expected_version was not provided we assume that the source code on this host is
157
-
* 3. TODO? - verifies a backup confirmation of the config directory received by the user/location exists
158
-
* updated and that the source code version and the schema version is the one we want to upgrade to
159
-
* QUESTION -
160
-
* 3. should we verify a backup, by stat of the backup location just have a confirmation of the user in the CLI
161
-
* 4. are there more verifications we should do?
157
+
* 3. The user's expected_hosts exist in system.json
158
+
* 4. If there are hosts in system.json that ere not provided in the expected_hosts we will print a warning but won't fail
159
+
* we do that because of hostname can be renamed, hosts that are on maintainance and we don't want to block the upgrade becuase it might take a lot of time,
160
+
* or because of hosts that used to be a part of the cluster and they were removed from the cluster, we don't get the updated info of the hosts on system.json
161
+
* therefore we can not treat the system.json as the source of truth of the hosts information
162
162
* @param {Object} system_data
163
163
* @param {String} expected_version
164
164
* @param {[String]} expected_hosts
@@ -176,20 +176,22 @@ class NCUpgradeManager {
176
176
if(!err_message&&!hostnames.length){
177
177
err_message=`config dir upgrade can not be started missing hosts_data hosts_data=${util.inspect(hosts_data)}`;
err_message=`config dir upgrade can not be started - expected_hosts missing one or more hosts specified in system.json hosts_data=${util.inspect(hosts_data)}`;
dbg.warn(`_verify_config_dir_upgrade - system.json contains one or more hosts info that are not specified in expected_hosts: hosts_data=${util.inspect(hosts_data)} expected_hosts=${util.inspect(expected_hosts)}`);
184
183
}
185
-
if(!err_message&&missing_hostnames){
186
-
err_message=`config dir upgrade can not be started - system.json missing one or more hosts info specified in expected_hosts hosts_data=${util.inspect(hosts_data)}`;
err_message=`config dir upgrade can not be started - expected_hosts contains one or more hosts that are not specified in system.json hosts_data=${util.inspect(hosts_data)} expected_hosts=${util.inspect(expected_hosts)}`;
err_message=`config dir upgrade can not be started until all nodes have the expected version=${new_version}, host=${host} host's current_version=${host_data.current_version}`;
194
+
err_message=`config dir upgrade can not be started until all expected hosts have the expected version=${new_version}, host=${cur_hostname} host's current_version=${host_data.current_version}`;
0 commit comments