Ignore files not named by a sha1 in the replication task storage
On NFS, deleting or renaming a file that a process on the same client
still has open turns it into a hidden ".nfsXXXX" file, which the client
removes once the process closes it. If the process dies first, the file
stays behind for good. With several primaries sharing the task storage,
this can happen to a task file that a primary is reading while it starts
or finishes the same task.
ReplicationTasksStorage listed such a file as a task, keyed by its file
name instead of the sha1 of the task. With the replication distributor
enabled this loops forever: every distribution cycle replays the file,
the resulting push cannot match the stored task by sha1, so it is pruned
as externally completed and scheduled again on the next cycle, on every
primary. The push never runs, since starting it renames the file named
after the sha1, which does not exist. For an ..all.. task this schedules
and cancels a full push of the project every few seconds, for as long as
the file exists.
Task files are always named after the sha1 of their task, so skip files
whose name is not a sha1 when walking the storage. This also covers other
stray files, such as editor or rsync leftovers.
Release-Notes: Ignore files not named by a sha1, such as NFS ".nfsXXXX" files, in the replication task storage, which the distributor kept rescheduling forever
Change-Id: I907be49b01103f11e483f8afdd2b6f2d983432fd
3 files changed