-
Bug
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
3
-
9223372036854775807
Migrating a file to an EC layout with "lfs migrate" (either a new layout such as "lfs migrate -c 2 --ec 2+1 FILE", or plain "lfs migrate FILE" of an EC file that reuses the file's own layout) copies the data into the volatile file and swaps the layouts, but nothing computes the parity. Data writes skip parity mirrors (LU-19527), so after the swap the parity components are stale and the file has no EC protection until "lfs mirror resync" is run. "lfs mirror verify" on the migrated file fails with "stale - read error" on the parity mirror.
"lfs mirror extend --ec" (LU-19548) already resyncs the parity it adds, and the migrate-to-mirrored change for LU-18332 resyncs new mirrors after merging them, but lfs_migrate() / migrate_block() / migrate_nonblock() do not.
Preferably the parity should be computed on the volatile file before the layout swap (e.g. with the combined data+parity resync of llapi_mirror_resync_many_params() from LU-12668), so the migrated file is never visible with stale parity, with the data version check at swap time catching concurrent writes. At minimum, lfs migrate should resync stale parity after the swap.
Separately, plain "lfs migrate FILE" of an EC file on master fails with EINVAL before any RPC (reported as "cannot create volatile file"), because llapi_pattern_to_lov() has no case for the raid0|parity (0x5) parity pattern; LU-20690 (bare LOV_PATTERN_PARITY with llapi mappings) fixes that for newly created files.