ranger
ranger copied to clipboard
RANGER-4923. optimize the issue where the policy writing process takes too long and causes incorrect permissions
When the number of policies is very large, such as exceeding 100,000, the policy file may grow larger than 100MB. In this case, the plugin may take several seconds or even longer to write the policies to the cache file using FileWriter. During this process, from clearing to writing the policy file, there may be issues with insufficient permissions. To resolve this issue, we can write the policy to a temporary file first and then use an atomic MV (which can be configured as a parameter) to handle the situation.