Watches and polls post fileOp messages by default (e.g. renames, mkdirs, links, delete), but this is usually unexpected and surprising, especially when downloading to a cluster.
I think we need a convenient, built in way to suppress fileOp messages and publish normal "file download" messages instead.
For example, a watch. A user uploads files named SOMETHING.TMP then renames to SOMETHING. The watch publishes two messages:
- a normal download mesages for SOMETHING.TMP
- a rename event to rename SOMETHING.TMP to SOMETHING
This is confusing outside of mirroring. The SOMETHING.TMP message fails to download (because SOMETHING.TMP is renamed and gone by the time the sarra tries to download it). And the rename message causes an error, because SOMETHING.TMP didn't get downloaded (even if it did, there's a good chance it would have been downloaded to another node). The rename message should fall through to download, so the file isn't lost, but the errors cause a lot of confusion.
Similar with links, when we are polling or posting files, usually we just want to receive a copy of the file. We don't want a link on our cluster, we want the actual file.
Posting directories (mkdir events) are mostly harmless, but they cause errors when v2 subscribers/sarras try to download them.
Changing the fileEvents option doesn't solve all of these cases. We usually use fileEvents create,modify because we need to detect creations and modifications (existing file gets overwritten or updated), but this causes renames to be posted.
Watches and polls post fileOp messages by default (e.g. renames, mkdirs, links, delete), but this is usually unexpected and surprising, especially when downloading to a cluster.
I think we need a convenient, built in way to suppress fileOp messages and publish normal "file download" messages instead.
For example, a watch. A user uploads files named
SOMETHING.TMPthen renames toSOMETHING. The watch publishes two messages:This is confusing outside of mirroring. The SOMETHING.TMP message fails to download (because SOMETHING.TMP is renamed and gone by the time the sarra tries to download it). And the rename message causes an error, because SOMETHING.TMP didn't get downloaded (even if it did, there's a good chance it would have been downloaded to another node). The
renamemessage should fall through to download, so the file isn't lost, but the errors cause a lot of confusion.Similar with links, when we are polling or posting files, usually we just want to receive a copy of the file. We don't want a link on our cluster, we want the actual file.
Posting directories (mkdir events) are mostly harmless, but they cause errors when v2 subscribers/sarras try to download them.
Changing the
fileEventsoption doesn't solve all of these cases. We usually usefileEvents create,modifybecause we need to detect creations and modifications (existing file gets overwritten or updated), but this causes renames to be posted.