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

   JIRA: https://issues.apache.org/jira/browse/CAMEL-24044
   
   Since the CAMEL-7810 optimistic-locking refactor (Camel 3.4), 
`PostgresAggregationRepository.insert()` built `INSERT INTO t(exchange, id, 
...) ON CONFLICT DO NOTHING` without the `version` column while the base 
`insertHelper` binds blob, key **and version** — one more bound parameter than 
placeholders, so every `add()` failed with `The column index is out of range` 
(verified against real PostgreSQL). With `storeBodyAsText=true` the version was 
silently bound into the `body` placeholder before failing. 
`ClusteredPostgresAggregationRepository` had the same defect in its 
completed-table insert (every `remove()` failed at completion) and never wrote 
the `instance_id` column, so instance-scoped recovery could never match any row.
   
   Changes:
   - Include the `version` column in both Postgres `INSERT` statements and pass 
the actual version instead of the hardcoded `1L`
   - Clustered variant additionally writes `instance_id` when `completed && 
recoveryByInstance`
   - New integration tests against real PostgreSQL 
(`camel-test-infra-postgres`) covering the full 
add/get/update/remove/recover/confirm lifecycle, `storeBodyAsText`, and 
instance-scoped recovery with two nodes — these fail on current `main` and pass 
with the fix
   - Fixed the stale `INSERT` example in the component docs and added an 
upgrade-guide entry (the aggregation tables need the `version BIGINT` column, 
as `JdbcAggregationRepository` already required for reads/updates)
   
   Run the new ITs with:
   `mvn verify -Pit 
-Dit.test='PostgresAggregationRepositoryIT,ClusteredPostgresAggregationRepositoryIT'
 -Dtest=NoSuchTest -Dsurefire.failIfNoSpecifiedTests=false`
   
   _Claude Code on behalf of Croway_
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)


-- 
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