Skip to content

[bugfix] Pinot config env substitution#10726

Closed
dd-willgan wants to merge 2 commits intoapache:masterfrom
dd-willgan:pinot-config-env-substitution
Closed

[bugfix] Pinot config env substitution#10726
dd-willgan wants to merge 2 commits intoapache:masterfrom
dd-willgan:pinot-config-env-substitution

Conversation

@dd-willgan
Copy link
Contributor

Fix environment variable substitution for specific configs in #10719

  • Fix access.control.init.password in controller config
  • Fix controller.segment.fetcher.auth.token in controller config
  • Fix pinot.server.segment.fetcher.auth.token, pinot.server.segment.uploader.auth.token, and pinot.server.instance.auth.token in server config

Changes

Tested

  • Added a test case checking the behavior with system properties (also interpolated but easier to mock than environment variables)
  • Built Pinot Docker image / deployed with Helm
    • Verified that environment variable substitution was working for access.control.init.password as default user when using ZK-based controller auth was working, previously it wasn't
    • Verified that the environment variable substitution was working for the auth tokens by creating a table, uploading a test segment to controller, and verifying that server was able to download the segment. Previously it wasn't since it didn't pass the right credentials when trying to download the segment from the controller

}
return rawProperty.toString();
}
return _configuration.getString(relaxPropertyName(name), defaultValue);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably keep the original logic for this one? (maybe check null first)
i don't think this change is needed as long as the previous bug fix is in. please double check

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I understood that mapValue() method correctly, using > 1 was on purpose. Basically, if a config has multi string values, those values are combined to a comma separated string; otherwise, return the raw property.

After discussion with @dd-willgan, I'm testing some ideas here: #10785, mainly to keep things backward compatible as much as possible. Let's see how that one goes.

Copy link
Contributor

@walterddr walterddr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm mostly. good catch

@dd-willgan
Copy link
Contributor Author

Closing since resolved in #10785, thanks @klsince and @walterddr

@walterddr
Copy link
Contributor

👍

@walterddr walterddr closed this May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants