node A: mutt7
node B: mutt8
base:   /p/lflood/defazio1/lustre-mv-stale.242630.1779300585
trigger post-rename cwd lookup on node B: true
collect Lustre debug logs: true
node A debug dump: /tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt7.dk
node B debug dump: /tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt8.dk
[mutt7] command:
  mkdir -p -- '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/p0/c0' '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/.sync' '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/.out'
[mutt7] command:
  touch -- '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/p0/c0/f'
[mutt7] command:
  mkdir -p -- '/tmp'
[mutt7] command:
  printf '%s\n' "$(lctl get_param -n debug)" > '/tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt7.restore.debug' && printf '%s\n' "$(lctl get_param -n subsystem_debug)" > '/tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt7.restore.subsystem_debug'
[mutt7] command:
  lctl clear
[mutt7] command:
  lctl set_param debug=+trace debug=+info debug=+inode debug=+dentry debug=+dlmtrace debug=+vfstrace
debug=+trace
debug=+info
debug=+inode
debug=+dentry
debug=+dlmtrace
debug=+vfstrace
[mutt7] command:
  lctl set_param subsystem_debug=+llite subsystem_debug=+mdc subsystem_debug=+ldlm
subsystem_debug=+llite
subsystem_debug=+mdc
subsystem_debug=+ldlm
[mutt7] command:
  lctl mark 'LU-20105 lustre-mv-stale.242630.1779300585 mutt7 debug capture start base=/p/lflood/defazio1/lustre-mv-stale.242630.1779300585 trigger=true'
[mutt8] command:
  mkdir -p -- '/tmp'
[mutt8] command:
  printf '%s\n' "$(lctl get_param -n debug)" > '/tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt8.restore.debug' && printf '%s\n' "$(lctl get_param -n subsystem_debug)" > '/tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt8.restore.subsystem_debug'
[mutt8] command:
  lctl clear
[mutt8] command:
  lctl set_param debug=+trace debug=+info debug=+inode debug=+dentry debug=+dlmtrace debug=+vfstrace
debug=+trace
debug=+info
debug=+inode
debug=+dentry
debug=+dlmtrace
debug=+vfstrace
[mutt8] command:
  lctl set_param subsystem_debug=+llite subsystem_debug=+mdc subsystem_debug=+ldlm
subsystem_debug=+llite
subsystem_debug=+mdc
subsystem_debug=+ldlm
[mutt8] command:
  lctl mark 'LU-20105 lustre-mv-stale.242630.1779300585 mutt8 debug capture start base=/p/lflood/defazio1/lustre-mv-stale.242630.1779300585 trigger=true'
[mutt7] command:
  lctl mark 'LU-20105 lustre-mv-stale.242630.1779300585 mutt7 initial tree created'
[mutt8] command:
  lctl mark 'LU-20105 lustre-mv-stale.242630.1779300585 mutt8 initial tree created'
[mutt8] command:
  start remote test shell
[mutt7] command:
  test -e '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/.sync/b-ready'
[mutt7] command:
  lctl mark 'LU-20105 lustre-mv-stale.242630.1779300585 mutt7 before mv c0 to c1'
[mutt8] command:
  lctl mark 'LU-20105 lustre-mv-stale.242630.1779300585 mutt8 before node A mv c0 to c1'
[mutt7] command:
  mv -- '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/p0/c0' '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/p0/c1'
[mutt7] command:
  lctl mark 'LU-20105 lustre-mv-stale.242630.1779300585 mutt7 after mv c0 to c1'
[mutt8] command:
  lctl mark 'LU-20105 lustre-mv-stale.242630.1779300585 mutt8 after node A mv c0 to c1'
[mutt7] command:
  touch -- '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/.sync/a-moved'
[mutt8] command:
  lctl mark 'LU-20105 lustre-mv-stale.242630.1779300585 mutt8 dump after node B final lookup'
[mutt8] command:
  lctl dk '/tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt8.dk'
Debug log: 40148 lines, 40148 kept, 0 dropped, 0 bad.
[mutt7] command:
  lctl mark 'LU-20105 lustre-mv-stale.242630.1779300585 mutt7 dump after node B final lookup'
[mutt7] command:
  lctl dk '/tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt7.dk'
Debug log: 11711 lines, 11711 kept, 0 dropped, 0 bad.

=== node A output ===
after rename on node A:
[mutt7] command:
  ls -lai '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/p0'
total 78
144127608081088619 drwx------ 3 root root 26624 May 20 11:09 .
144127608081088618 drwx------ 5 root root 26624 May 20 11:09 ..
144127608081088620 drwx------ 2 root root 26624 May 20 11:09 c1
[mutt7] command:
  stat '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/p0/c0' 2>&1 || true
stat: cannot statx '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/p0/c0': No such file or directory
[mutt7] command:
  stat -c 'c1: dev=%D ino=%i nlink=%h name=%n' '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/p0/c1'
c1: dev=11602e98 ino=144127608081088620 nlink=2 name=/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/p0/c1
[mutt7] command:
  lfs path2fid '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/p0/c1' 2>&1 || true
[0x2000b4bc2:0x6c:0x0]

=== node B ssh output ===
[mutt8] cd into original directory
[mutt8] command:
   cd /p/lflood/defazio1/lustre-mv-stale.242630.1779300585/p0/c0
[mutt8] command:
   lctl mark LU-20105\ lustre-mv-stale.242630.1779300585\ mutt8\ node\ B\ entered\ original\ c0
[mutt8] command:
   touch /p/lflood/defazio1/lustre-mv-stale.242630.1779300585/.sync/b-ready
[mutt8] command:
   lctl mark LU-20105\ lustre-mv-stale.242630.1779300585\ mutt8\ node\ B\ ready\ for\ node\ A\ rename
[mutt8] waiting for /p/lflood/defazio1/lustre-mv-stale.242630.1779300585/.sync/a-moved
[mutt8] command:
   lctl mark LU-20105\ lustre-mv-stale.242630.1779300585\ mutt8\ node\ B\ observed\ node\ A\ rename\ complete
[mutt8] command:
   cd /p/lflood/defazio1/lustre-mv-stale.242630.1779300585/p0
[mutt8] command:
   lctl mark LU-20105\ lustre-mv-stale.242630.1779300585\ mutt8\ node\ B\ moved\ to\ parent\ p0

=== node B collected output ===
[mutt7] command:
  cat '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/.out/b-before.txt' '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/.out/b-trigger.txt' '/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/.out/b-final.txt'
before rename:
[mutt8] command:
   pwd -P
/p/lflood/defazio1/lustre-mv-stale.242630.1779300585/p0/c0
[mutt8] command:
   ls -laid .
144127608081088620 drwx------ 2 root root 26624 May 20 11:09 .
[mutt8] command:
   stat -c cwd\ before:\ dev=%D\ ino=%i\ nlink=%h\ name=%n .
cwd before: dev=11602e98 ino=144127608081088620 nlink=2 name=.
[mutt8] command:
   lfs path2fid .
[0x2000b4bc2:0x6c:0x0]
trigger while still in old cwd:
[mutt8] command:
   lctl mark LU-20105\ lustre-mv-stale.242630.1779300585\ mutt8\ before\ post-rename\ cwd\ trigger
[mutt8] command:
   ls -d .
.
[mutt8] command:
   ls -laid .
144127608081088620 drwx------ 2 root root 26624 May 20 11:09 .
[mutt8] command:
   stat -c cwd\ after\ trigger:\ dev=%D\ ino=%i\ nlink=%h\ name=%n .
cwd after trigger: dev=11602e98 ino=144127608081088620 nlink=2 name=.
[mutt8] command:
   lfs path2fid .
[0x2000b4bc2:0x6c:0x0]
[mutt8] command:
   lctl mark LU-20105\ lustre-mv-stale.242630.1779300585\ mutt8\ after\ post-rename\ cwd\ trigger
parent listing after leaving cwd:
[mutt8] command:
   lctl mark LU-20105\ lustre-mv-stale.242630.1779300585\ mutt8\ before\ final\ parent-relative\ lookups
[mutt8] command:
   ls -lai .
total 78
144127608081088619 drwx------ 3 root root 26624 May 20 11:09 .
144127608081088618 drwx------ 5 root root 26624 May 20 11:09 ..
144127608081088620 drwx------ 2 root root 26624 May 20 11:09 c1

old name lookup:
[mutt8] command:
   stat -c c0:\ dev=%D\ ino=%i\ nlink=%h\ name=%n c0
c0: dev=11602e98 ino=144127608081088620 nlink=2 name=c0
BUG: c0 stat succeeded

new name lookup:
[mutt8] command:
   stat -c c1:\ dev=%D\ ino=%i\ nlink=%h\ name=%n c1
c1: dev=11602e98 ino=144127608081088620 nlink=2 name=c1

fid comparison:
[mutt8] command:
   lfs path2fid c0 c1
c0: [0x2000b4bc2:0x6c:0x0]
c1: [0x2000b4bc2:0x6c:0x0]

[mutt8] command:
  test c0 -ef c1
BUG: c0 and c1 resolve to the same object
[mutt8] command:
   lctl mark LU-20105\ lustre-mv-stale.242630.1779300585\ mutt8\ after\ final\ parent-relative\ lookups

=== Lustre debug dumps ===
mutt7: /tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt7.dk
mutt8: /tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt8.dk

RESULT: reproduced stale old-name lookup
[mutt8] command:
  lctl mark 'LU-20105 lustre-mv-stale.242630.1779300585 mutt8 restoring debug masks' || true
[mutt8] command:
  lctl set_param debug="$(cat '/tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt8.restore.debug')" subsystem_debug="$(cat '/tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt8.restore.subsystem_debug')" || true
debug=ioctl neterror warning error emerg ha config console
subsystem_debug=undefined mdc mds osc ost class log llite rpc mgmt lnet lnd pinger filter libcfs echo ldlm lov lquota osd lfsck snapshot lmv sec gss mgc mgs fid fld
[mutt7] command:
  lctl mark 'LU-20105 lustre-mv-stale.242630.1779300585 mutt7 restoring debug masks' || true
[mutt7] command:
  lctl set_param debug="$(cat '/tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt7.restore.debug')" subsystem_debug="$(cat '/tmp/lu20105-lustre-mv-stale.242630.1779300585-mutt7.restore.subsystem_debug')" || true
debug=ioctl neterror warning error emerg ha config console
subsystem_debug=undefined mdc mds osc ost class log llite rpc mgmt lnet lnd pinger filter libcfs echo ldlm lov lquota osd lfsck snapshot lmv sec gss mgc mgs fid fld
leaving repro directory for inspection: /p/lflood/defazio1/lustre-mv-stale.242630.1779300585
