Closed lipppppp closed 3 years ago
In order to solve this problem, I made the following design. If you have any good suggestions, welcome to discuss. 1.Create a new file 'smart.properties' to store smart.last.fetch.dirs property. This property records last fetch path. 2.Check whether the path in the current whitelist is the same as the previous one at each restart. If the whitelist changed, namespace will be fetched fully again. 3.Finally, update smart.last.fetch.dirs property to current whitelist path.
If fetched dirs are maintained in local master smart server, what if master is down and standby smart server takes the role? Maybe, we have to maintain fetched dirs in database which is accessible by two or more smart servers.
Good suggestions. If HA happens, new active smart server will fetch namespace fully and create a new smart.properties in the local dir. This causes unnecessary workload. Maintaining fetched dirs in database is a better choice.
The patch looks good to me. Will commit soon.
The inotify event will be filtered by whitelist when whitelist is enabled. If user create some files which is not in the whitelist, these inotify events won't be recorded in SSM. But if user wants to add these new files path to whitelist after creating, their inotify events already filtered which leads to their metadata missing in the file table.