Skip to content

Commit 007a2ec

Browse files
authored
Merge pull request apache#167 from smongiar/jta-jpa-ocp-narajana-tx
[JtaJpa] - Transaction node id should be unique and less than 28 characters on OCP
2 parents d66ed43 + 259b386 commit 007a2ec

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

spring-boot-jta-jpa-autoconfigure/README.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ INFO [scheduling-1] dev.snowdrop.boot.narayana.openshift.recovery.StatefulsetRec
213213

214214
After finishing its pending work the statefulset can be scaled down as usual.
215215

216+
=== Additional notes about Openshift running
217+
218+
In order to have different node-id on concurrent pods, we set the property `narayana.shorten-node-identifier-if-necessary=true`.
219+
220+
The result is a shortening ensuring the transaction node-id to be less than 28 characters. It's implemented by hashing the node name, encoding the hash to Base64 and then truncating the result. It is safe to enable it but keep in mind that: "As with all hashes, the resulting shortened node name could potentially conflict with another shortened node name, but it is very unlikely."
221+
216222
=== Help and contributions
217223

218224
If you hit any problem using Camel or have some feedback, then please https://camel.apache.org/support.html[let us know].

spring-boot-jta-jpa-autoconfigure/src/main/resources/application-openshift.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ spring.datasource.username=admin
2222
spring.datasource.password=admin
2323
storage.path=${STORAGE_PATH}
2424
narayana.transaction-manager-id=${POD_NAME}
25+
narayana.shorten-node-identifier-if-necessary=true
2526
narayana.log-dir=${STORAGE_PATH}/${POD_NAME}
2627
snowdrop.narayana.openshift.recovery.enabled=true
2728
snowdrop.narayana.openshift.recovery.current-pod-name=${POD_NAME}

0 commit comments

Comments
 (0)