Croway opened a new pull request, #24595:
URL: https://github.com/apache/camel/pull/24595

   # Description
   
   PostgreSQL ships with `max_prepared_transactions = 0`, which disables 
prepared transactions entirely — any XA two-phase commit against it fails at 
prepare time with:
   
   ```
   ERROR: prepared transactions are disabled
   Hint: Set "max_prepared_transactions" to a nonzero value.
   ```
   
   This is easy to miss because a JTA transaction with a *single* participant 
never issues `PREPARE TRANSACTION` (one-phase-commit optimization); the failure 
only appears once a second resource (e.g. JMS) enlists in the same transaction. 
The parameter can only be changed with a server restart, so it cannot be fixed 
after the fact on a running container.
   
   This change starts the `camel-test-infra-postgres` container with `-c 
max_prepared_transactions=100`, appended to the command already configured by 
testcontainers so the existing `-c fsync=off` is preserved. It benefits both 
test-infra consumers (e.g. enables writing real two-resource 2PC tests for 
camel-jta) and `camel infra run postgres` users running distributed XA examples.
   
   Risk to existing tests is minimal: the setting is purely additive capacity 
(shared-memory slots for prepared transactions) and changes nothing for clients 
that never issue `PREPARE TRANSACTION`. Verified by starting the service and 
checking `SHOW max_prepared_transactions` returns `100` with the container 
command `postgres -c fsync=off -c max_prepared_transactions=100`.
   
   # Target
   
   - [x] I checked that the commit is targeting the correct branch (note that 
Camel 3 uses `camel-3.x`, whereas Camel 4 uses the `main` branch)
   
   # Tracking
   - [ ] If this is a large change, bug fix, or code improvement, I checked 
there's a JIRA issue filed for the change (usually before you start working on 
it).
   
   # Apache Camel coding standards and style
   
   - [x] I checked that each commit in the pull request has a meaningful 
subject line and body.
   - [x] I have run `mvn clean install -DskipTests` locally from root folder 
for the affected module and I have committed all auto-generated changes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to