mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-09 14:34:43 +00:00
Remote nodes in cross-cluster search can be marked as eligible for acting a gateway node via a remote node attribute setting. For example, if search.remote.node.attr is set to "gateway", only nodes that have node.attr.gateway set to "true" can be connected to for cross-cluster search. Unfortunately, there is a bug in the handling of these attributes due to the use of a dangerous method Boolean#getBoolean(String) which obtains the system property with specified name as a boolean. We are not looking at system properties here, but node settings. This commit fixes this situation, and adds a test. A follow-up will ban the use of Boolean#getBoolean. Relates #23863