Attila Bukor has submitted this change and it was merged. ( http://gerrit.cloudera.org:8080/15374 )
Change subject: KUDU-3079 Add MiniPostgres ...................................................................... KUDU-3079 Add MiniPostgres Apache Ranger needs a database to store privileges and supported databases currently are MySQL, PostgreSQL, Oracle and Amazon RDS[1]. I ruled out Amazon RDS on the basis that it's cloud-based so we couldn't depend on it in integration tests in a self-contained way. This is only a build-time dependency (test-time really) and only for an optional feature, so licensing shouldn't be too much of a concern for any of them, but PostgreSQL License can even be included in ASF software[2]. It's also easy to build and configure and it doesn't otherwise matter which database is used under Ranger, so I went with Postgres. This patch adds the latest (at the time of the start of this work) PostgreSQL and PostgreSQL JDBC driver JARs to thirdparty and adds a MiniPostgres interface that tests can use to start Postgres, add users and create databases. The patch also adds two utility methods that MiniPostgres uses: - Subprocess::WaitAndCheckExitCode() is the same as Wait(), but it only returns OK if the exit code is 0. If the subprocess was killed, stopped or exited with a non-zero exit code, it fails. - GetRandomPort() in net_util.h that returns a random unused port. I also removed the BaseName(argv[0]) call in Subprocess as that doesn't seem to be the correct behavior according to exec(3) man page as Adar pointed out. [1] https://docs.cloudera.com/HDPDocuments/HDP3/HDP-3.1.5/installing-ranger/content/configuring_a_database_instance_for_ranger.html (couldn't find a list of supported databases on ranger.apache.org or on cwiki.apache.org) [2] https://www.apache.org/legal/resolved.html#category-a Change-Id: Iba40126aa60e0ecbc5ae10cc1328493194c345bc Reviewed-on: http://gerrit.cloudera.org:8080/15374 Reviewed-by: Hao Hao <[email protected]> Reviewed-by: Adar Dembo <[email protected]> Tested-by: Attila Bukor <[email protected]> --- M CMakeLists.txt M build-support/dist_test.py M build-support/run_dist_test.py A src/kudu/postgres/CMakeLists.txt A src/kudu/postgres/mini_postgres-test.cc A src/kudu/postgres/mini_postgres.cc A src/kudu/postgres/mini_postgres.h M src/kudu/ranger/CMakeLists.txt M src/kudu/tools/kudu-tool-test.cc M src/kudu/util/net/net_util-test.cc M src/kudu/util/net/net_util.cc M src/kudu/util/net/net_util.h M src/kudu/util/subprocess.cc M src/kudu/util/subprocess.h M thirdparty/LICENSE.txt M thirdparty/build-definitions.sh M thirdparty/build-thirdparty.sh M thirdparty/download-thirdparty.sh M thirdparty/vars.sh 19 files changed, 468 insertions(+), 7 deletions(-) Approvals: Hao Hao: Looks good to me, approved Adar Dembo: Looks good to me, approved Attila Bukor: Verified -- To view, visit http://gerrit.cloudera.org:8080/15374 To unsubscribe, visit http://gerrit.cloudera.org:8080/settings Gerrit-Project: kudu Gerrit-Branch: master Gerrit-MessageType: merged Gerrit-Change-Id: Iba40126aa60e0ecbc5ae10cc1328493194c345bc Gerrit-Change-Number: 15374 Gerrit-PatchSet: 27 Gerrit-Owner: Attila Bukor <[email protected]> Gerrit-Reviewer: Adar Dembo <[email protected]> Gerrit-Reviewer: Alexey Serbin <[email protected]> Gerrit-Reviewer: Andrew Wong <[email protected]> Gerrit-Reviewer: Attila Bukor <[email protected]> Gerrit-Reviewer: Hao Hao <[email protected]> Gerrit-Reviewer: Kudu Jenkins (120) Gerrit-Reviewer: Tidy Bot (241)
