LiskArchive / lisk-sdk

🔩 Lisk software development kit
https://lisk.com
Apache License 2.0
2.72k stars 456 forks source link

Commander may overwrite instance while upgrading another #3910

Closed fchavant closed 5 years ago

fchavant commented 5 years ago

Expected behavior

Upgrading an instance name primary does not affect the backup instance.

Actual behavior

~/.lisk/instances/backup/ gets removed by core:upgrade primary

Steps to reproduce

lisk core:install primary
lisk core:install backup
lisk core:upgrade primary

Which version(s) does this affect? (Environment, OS, etc...)

2.2.0

ManuGowda commented 5 years ago

This issue is no longer valid, as the backups logic was moved to the root of .lisk so the new structure will be

.lisk/instances
.lisk/backups

Here is the logs from testing

❯ ls -l ~/.lisk/instances       
total 8
drwxr-xr-x  30 manu  staff  960 Aug 16 10:35 backups
-rw-r--r--   1 manu  staff  139 Aug 16 10:35 error.log
drwxr-xr-x  30 manu  staff  960 Aug 16 10:33 primary

lisk-sdk/commander git/release/2.3.0  
❯ ls -l ~/.lisk/         
total 8
drwxr-xr-x   4 manu  staff  128 Aug 16 10:35 backups
-rw-r--r--   1 manu  staff  117 Aug 14 16:34 config.json
drwx------   3 manu  staff   96 Apr 12 18:00 configstore
drwxr-xr-x   5 manu  staff  160 Aug 16 10:35 instances
drwxr-xr-x   2 manu  staff   64 Apr 24 15:31 network
drwxr-xr-x  12 manu  staff  384 Aug  8 15:37 pm2
drwxr-xr-x   4 manu  staff  128 Feb 25 11:56 temp

lisk-sdk/commander git/release/2.3.0  
❯ ls -l ~/.lisk/backups      
total 0
drwxr-xr-x  30 manu  staff  960 Aug 16 10:35 backups
drwxr-xr-x  30 manu  staff  960 Aug 16 10:33 primary