Mercurial > hg > orthanc-book
comparison Sphinx/source/plugins/postgresql.rst @ 1016:02e04288bbeb
pg-transactions
author | Alain Mazy <am@osimis.io> |
---|---|
date | Fri, 19 Jan 2024 15:53:17 +0100 |
parents | 05b106383b2a |
children | 3f3a1b54a839 |
comparison
equal
deleted
inserted
replaced
1015:f263cd65a754 | 1016:02e04288bbeb |
---|---|
130 "Username" : "orthanc", | 130 "Username" : "orthanc", |
131 "Password" : "orthanc", | 131 "Password" : "orthanc", |
132 "EnableSsl" : false, // New in release 3.0 | 132 "EnableSsl" : false, // New in release 3.0 |
133 "MaximumConnectionRetries" : 10, // New in release 3.0 | 133 "MaximumConnectionRetries" : 10, // New in release 3.0 |
134 "ConnectionRetryInterval" : 5, // New in release 3.0 | 134 "ConnectionRetryInterval" : 5, // New in release 3.0 |
135 "IndexConnectionsCount" : 1 // New in release 4.0 | 135 "IndexConnectionsCount" : 1, // New in release 4.0 |
136 "TransactionMode": "SERIALIZABLE" // New in beta version (not released yet) | |
136 }, | 137 }, |
137 "Plugins" : [ | 138 "Plugins" : [ |
138 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so", | 139 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLIndex.so", |
139 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLStorage.so" | 140 "/home/user/orthanc-databases/BuildPostgreSQL/libOrthancPostgreSQLStorage.so" |
140 ] | 141 ] |
241 the index plugin to the PostgreSQL database. It is set to ``1`` by | 242 the index plugin to the PostgreSQL database. It is set to ``1`` by |
242 default, which corresponds to the old behavior of Orthanc <= 1.9.1. | 243 default, which corresponds to the old behavior of Orthanc <= 1.9.1. |
243 | 244 |
244 * ``ConnectionRetryInterval`` is only used when opening one database | 245 * ``ConnectionRetryInterval`` is only used when opening one database |
245 connection to PostgreSQL. | 246 connection to PostgreSQL. |
247 | |
248 * ``TransactionMode`` has been added in the ``pg-transactions`` beta version only. 2 values are | |
249 allowed: ``SERIALIZABLE`` (that has always been the default mode for Orthanc) | |
250 and ``READ COMMITTED`` that is available only from this beta version. See | |
251 below. | |
246 | 252 |
247 * The PostgreSQL plugin supports the :ref:`revision mechanism | 253 * The PostgreSQL plugin supports the :ref:`revision mechanism |
248 <revisions>` to protect metadata and attachments from concurrent | 254 <revisions>` to protect metadata and attachments from concurrent |
249 modifications. | 255 modifications. |
250 | 256 |
308 ^^^^^^^^^^^ | 314 ^^^^^^^^^^^ |
309 | 315 |
310 When configuring your PostgreSQL plugin, ensure you've read the :ref:`scalability section | 316 When configuring your PostgreSQL plugin, ensure you've read the :ref:`scalability section |
311 <scalability>` | 317 <scalability>` |
312 | 318 |
319 Transaction modes (``pg-transactions`` beta version only) | |
320 ^^^^^^^^^^^^^^^^^ | |
321 | |
322 .. highlight:: json | |
323 | |
324 Starting from the current beta version, orthanc supports 2 transaction modes that | |
325 can be configured in the ``TransactionMode`` configuration of the ``PostgreSQL`` plugin: | |
326 | |
327 - ``SERIALIZABLE`` in which all write transactions are serialized which might lead | |
328 to performance bottlenecks when lots of threads or Orthanc instances are trying | |
329 to write to the same Database. | |
330 - ``READ COMIITED`` that allows multiple threads or Orthanc instances to write at the | |
331 same time to the same Database. | |
332 | |
333 *Remark:* This feature is only available in a beta version of both Orthanc and the | |
334 PostgreSQL plugin (``pg-transactions`` branches in the code). This beta version is | |
335 only available in the ``osimis/orthanc:pg-transactions-unstable`` Docker image. | |
336 | |
337 *Remark:* This beta version is really a beta version and **should not be used on a | |
338 production database**. It shall only be used on a DB that you can delete or recover. | |
339 The reason why it shall not be used on a production database is because this revision | |
340 modifies the DB schema to a :ref:`version <db-versioning>`/revision ``6.2`` that might be different from the | |
341 final schema of the future release although it will share the same version/revision. | |
342 We can not guarantee to maintain migration scripts from this temporary schema to the final | |
343 one. | |
344 | |
345 Upgrades/Downgrades (``pg-transactions`` beta version only) | |
346 ^^^^^^^^^^^^^^^^^ | |
347 | |
348 New vesions of the PostgreSQL might modify the DB schema by adding new columns/tables/triggers. | |
349 Upgrades from one revision to the other is always automatic. | |
350 | |
351 However, if, for some reasons, you would like to reinstall a previous plugin version, the | |
352 older plugin might refuse to start because the revision is newer and unknown to it. | |
353 | |
354 Starting from this beta version, we are providing a downgrade script in case you want, e.g, | |
355 to reinstall Orthanc 1.12.2 and PostgreSQL 5.1 (DB schema revision 6.1). | |
356 | |
357 To downgrade from the beta to the PostgreSQL 5.1, one might run this procedure:: | |
358 | |
359 $ wget https://orthanc.uclouvain.be/hg/orthanc-databases/raw-file/pg-transactions/PostgreSQL/Plugins/SQL/Downgrades/V6.2ToV6.1.sql | |
360 $ psql -U postgres -f V6.2ToV6.1.sql | |
361 | |
313 | 362 |
314 Troubleshooting | 363 Troubleshooting |
315 --------------- | 364 --------------- |
316 | 365 |
317 SCRAM authentication | 366 SCRAM authentication |