-
Notifications
You must be signed in to change notification settings - Fork 155
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[maintenance][leo_storage] Needs to deliver moving AVS directory after launching #660
Comments
I've fixed this issue, and shared an operation example as below: Execute
|
@yosukehara This is nice tool, but I think there are two problems. First, it creates incorrect symlinks in "log" directory. Example log:
Result:
Also it created incorrect link to AVS file - to older version (but this is bug specific to my system, I wrote about it here: #644 (comment))
This can be fixed by using Second problem is that when run as root, it doesn't carry ownership of original files, if they are owned by some other user. This is fixed by using I've checked with these changes (vstax@3f12d3e) and it works fine after that. |
@vstax Thank you for sharing the informative report. I'll fix that. |
@mocchira I'd like to ask you to review the code whether other problems still exist or not. |
@yosukehara Yes I'm now reviewing while considering @vstax suggestions. I will drop the comment later. |
Review here.
Right.
Nod enough. Cases for not working.
$ ls -al package/leo_storage/avs/log/
total 92
drwxrwxr-x 2 leofs leofs 4096 Mar 30 11:00 .
drwxrwxr-x 5 leofs leofs 4096 Mar 30 10:37 ..
lrwxrwxrwx 1 leofs leofs 89 Mar 30 11:00 leo_object_storage_0 -> /home/leofs/dev/leofs.18.3/package/leo_storage/avs/log/leo_object_storage_0.20170330.11.1
-rw-rw-r-- 1 leofs leofs 239 Mar 30 10:39 leo_object_storage_0.20170330.10.1
-rw-rw-r-- 1 leofs leofs 0 Mar 30 11:00 leo_object_storage_0.20170330.11.1
-rw-rw-r-- 1 leofs leofs 343 Mar 30 10:39 leo_object_storage_0.report.63658057179 Now those entries wrongly migrated into $ ls -al tmp/log/
total 92
drwxrwxr-x 2 leofs leofs 4096 Mar 30 10:55 .
drwxrwxr-x 5 leofs leofs 4096 Mar 30 10:55 ..
lrwxrwxrwx 1 leofs leofs 74 Mar 30 10:55 leo_object_storage_0 -> /home/leofs/dev/leofs.18.3/tmp/log/leo_object_storage_0.report.63658057179
-rw-rw-r-- 1 leofs leofs 239 Mar 30 10:39 leo_object_storage_0.20170330.10.1
-rw-rw-r-- 1 leofs leofs 0 Mar 30 10:39 leo_object_storage_0.20170330.10.2
-rw-rw-r-- 1 leofs leofs 343 Mar 30 10:39 leo_object_storage_0.report.63658057179 OMG! Now the symlink refer to a report file NOT the original one
$ ls -al package/leo_storage/avs/object/
total 96
drwxrwxr-x 2 leofs leofs 4096 Mar 30 10:37 .
drwxrwxr-x 5 leofs leofs 4096 Mar 30 10:37 ..
lrwxrwxrwx 1 leofs leofs 75 Mar 30 10:37 0.avs -> /home/leofs/dev/leofs.18.3/package/leo_storage/avs/object/0.avs_63658057055
-rw-rw-r-- 1 leofs leofs 719 Mar 30 10:38 0.avs_63658057055
-rw-rw-r-- 1 leofs leofs 522 Mar 30 10:37 0.avs_63658057072 Now those wrongly migrated into $ ls -al tmp/object/
total 64
drwxrwxr-x 2 leofs leofs 4096 Mar 30 10:55 .
drwxrwxr-x 5 leofs leofs 4096 Mar 30 10:55 ..
lrwxrwxrwx 1 leofs leofs 55 Mar 30 10:55 0.avs -> /home/leofs/dev/leofs.18.3/tmp/object/0.avs_63658057072
-rw-rw-r-- 1 leofs leofs 719 Mar 30 10:38 0.avs_63658057055
-rw-rw-r-- 1 leofs leofs 522 Mar 30 10:37 0.avs_63658057072 OMG! Now the symlink refer to a temporal compacted file NOT the original one That being said, we have to track which files/directories were symlinked in the first place. Also one more thing for the code clarity. -if `echo $src | tail -c2 | grep -q '/'` ; then
- src=`echo $src | rev | cut -c 2- | rev`
-fi
-if `echo $dest | tail -c2 | grep -q '/'` ; then
- dest=`echo $dest | rev | cut -c 2- | rev`
-fi
+src=${src%/}
+dest=${dest%/} That's all from me. |
In conclusion, I need to fix two problems:
|
Fixed |
I've realized we need to deliver moving AVS directories after launching a LeoFS system to more smoothly migrate it. The current version of LeoStorage creates many symlinks under AVS' directories which are
log
,object
, andmetadata
.The text was updated successfully, but these errors were encountered: