-
Notifications
You must be signed in to change notification settings - Fork 9
Pgpool-II: Example about "In Memory Query Cache" #1292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
WalkthroughAdds a new Pgpool-II integration for CrateDB: Docker Compose orchestration, Pgpool configuration, a test orchestration script, documentation, and a GitHub Actions workflow to run the test stack. Changes
Sequence Diagram(s)sequenceDiagram
participant CI as GitHub Actions
participant Runner as Test host
participant Compose as Docker Compose
participant Pgpool as Pgpool-II
participant Crate as CrateDB
CI->>Runner: checkout + run application/pgpool/test.sh
Runner->>Compose: docker compose up --detach (cratedb, pgpool)
Compose->>Crate: start CrateDB (healthcheck)
Compose->>Pgpool: start Pgpool-II (healthcheck)
Compose->>Compose: run provision-functions after Crate & Pgpool healthy
Compose->>Pgpool: run pgpool-query-data (client query via Pgpool)
Pgpool->>Crate: forward queries
Crate-->>Pgpool: query responses
Pgpool-->>Runner: return query results (task exit)
Runner-->>CI: test.sh exits (status)
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes
Poem
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
application/pgpool/compose.yml
Outdated
| # BACKEND Error: "Unknown function: pg_catalog.has_function_privilege('crate', 'pgpool_regclass(cstring)', 'execute')" | ||
| provision-functions: | ||
| image: docker.io/crate/crate:nightly | ||
| entrypoint: /bin/bash -c | ||
| command: | ||
| - | | ||
| crash --hosts "http://cratedb:4200" <<SQL | ||
| CREATE OR REPLACE FUNCTION pg_catalog.has_function_privilege(string, string, string) | ||
| RETURNS BOOLEAN | ||
| LANGUAGE JAVASCRIPT | ||
| AS 'function has_function_privilege(foo, bar, baz) { return true; }'; | ||
| SQL | ||
| deploy: | ||
| replicas: 0 | ||
| depends_on: | ||
| cratedb: | ||
| condition: service_healthy | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This detail about missing pg_catalog.has_function_privilege() needs to be reported to crate/crate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
application/pgpool/notes.md
Outdated
| ``` | ||
| LOG: get_query_result: do_query failed | ||
| LOG: get_query_result: no result returned | ||
| ERROR : Unknown function: pg_catalog.pg_is_in_recovery() | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Substitute and/or implement pg_catalog.pg_is_in_recovery(), i.e. also report to crate/crate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Substituted as UDF with 327350a, and reported to the database issue tracker.
application/pgpool/notes.md
Outdated
| ``` | ||
| WARNING: is_temp_table: unexpected PostgreSQL version: CrateDB 6.2.0-SNAPSHOT (built 9e707bd/NA, Linux 6.12.54-linuxkit amd64, OpenJDK 64-Bit Server VM 25.0.1+8-LTS) | ||
| ``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is is_temp_table also a missing function, or is that message just some other spurious side effect? Is it actionable or ignorable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a function in Pgpool-II: Because the PostgreSQL implementation is based on the server version, the code needs to do a version inquiry first. That's where this warning is coming from, because CrateDB's version string doesn't parse like PostgreSQL's.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it advisable to submit a patch to make Pgpool also accept non-PostgreSQL servers (e.g. CrateDB) here with a reasonable default implementation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's unlikely that Pgpool-II will accept a patch for CrateDB, and it's only a WARNING, so let's ignore it?
About
Explore Pgpool-II's In Memory Query Cache with CrateDB.
References
/cc @surister