v.24.5Improvement

Fix interserver secret for Distributed from remote

Fix interserver secret for Distributed over Distributed from remote. #63013 (Azat Khuzhin).
Fix handling of the interserver secret for Distributed tables when using Distributed over Distributed with the remote table function.

Why it matters

This fix resolves issues with authentication and communication between servers in setups where a Distributed table queries another Distributed table using the remote function. It ensures that the interserver secret is correctly applied, improving security and stability in multi-layer distributed queries.

How to use it

No special configuration is needed from the user side. The interserver secret will now be correctly handled automatically when performing Distributed over Distributed queries involving the remote table function. Ensure the interserver secret is properly set in the server configuration as usual.