`watch_file_user_provider` does not work when given a symlink chain
What type of bug is this?
Incorrect result, Configuration
What subsystems are affected?
Standalone mode
Minimal reproduce step
Untested pseudocode:
mkdir /tmp/secrets.1
echo 'user1=foo' > /tmp/secrets.1/users
ln -s /tmp/secrets.1 /tmp/secrets
ln -s /tmp/secrets/users users
echo 'user_provider = "watch_file_user_provider:users"' > config.toml
./greptime standalone startThen some time later,
mkdir /tmp/secrets.2
echo 'user2=bar' > /tmp/secrets.2/users
ln -sf /tmp/secrets.2 /tmp/secrets(I use a configuration management system that atomatically updates secrets by swapping a single directory symlink as shown here.)
What did you expect to see?
GreptimeDB should pick up the new user file within a short period of time
What did you see instead?
GreptimeDB doesn't pick up the new user file until it is manually restarted
(I did a quick code dive and it looks like it only sets up a file watcher on the immediate parent of the original path. It probably needs to recursively watch all parents of each element of a symlink chain if it wants to discover when a symlink is replaced. Alternatively, it could just fall back to polling for changes if given a path that involves symlinks.)
What operating system did you use?
NixOS 26.05
What version of GreptimeDB did you use?
1.2.1
Relevant log output and stack trace
Source: GreptimeTeam/greptimedb