Details
-
Improvement
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
3
-
9223372036854775807
Description
The llapi_mirror_copy_many() function was implemented during early FLR development and has remained largely unused/unchanged since then. It appears only to be used by the (unused?) lfs mirror copy command and a few test cases. It is lacking "proper" sparse file support, in that it is truncating the whole target mirror(s) and then copying the data over, which has some risk of data loss if the copy process is interrupted and the primary mirror is lost.
While this function cannot immediately be removed due to API compatibility requirements, it would be better to use the copy engine in llapi_mirror_resync_many() function that is used by lfs mirror resync, that has seen a number of improvements (better sparse file handling, progress statistics) and will continue to be improved in the future.
It would also be good to move llapi_mirror_find(), llapi_mirror_find_stale(), and llapi_mirror_resync_many{_params}() to liblustreapi_mirror.c from their current residence in liblustreapi_layout.c to keep the mirror handling code together as well as reduce the size of liblustreapi_layout.c a bit.