You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-commits@jackrabbit.apache.org by re...@apache.org on 2019/01/31 11:33:40 UTC

svn commit: r1852584 - /jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/document/rdb-document-store.md

Author: reschke
Date: Thu Jan 31 11:33:40 2019
New Revision: 1852584

URL: http://svn.apache.org/viewvc?rev=1852584&view=rev
Log:
OAK-7960: RDB: add to Oak documentationRDB: add to Oak documentation (work in progress)

Modified:
    jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/document/rdb-document-store.md

Modified: jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/document/rdb-document-store.md
URL: http://svn.apache.org/viewvc/jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/document/rdb-document-store.md?rev=1852584&r1=1852583&r2=1852584&view=diff
==============================================================================
--- jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/document/rdb-document-store.md (original)
+++ jackrabbit/oak/trunk/oak-doc/src/site/markdown/nodestore/document/rdb-document-store.md Thu Jan 31 11:33:40 2019
@@ -50,7 +50,11 @@ For production use:
 For supported databases, `RDBDocumentStoreDB` has knowledge about supported
 versions (and likewise supported JDBC drivers). Watch out for log messages
 during system startup which might warn about outdated versions (the system
-will attempt to start anyway).
+will attempt to start anyway):
+
+~~~
+12:20:20.864 ERROR [main] RDBDocumentStore.java:1014        Unsupported Apache Derby version: 9.14, expected at least 10.11
+~~~
 
 
 ## Database Creation
@@ -71,7 +75,14 @@ the correct operation:
 
 The implementation will try to create all tables and indices when they are not present
 yet. Of course this requires that the configured database user actually has
-permission to do so. If it does not, the system will not start up and provide
+permission to do so. Example from system log:
+
+~~~
+12:20:22.705 INFO  [main] RDBDocumentStore.java:1063        RDBDocumentStore (SNAPSHOT) instantiated for database Apache Derby 10.14.2.0 - (1828579) (10.14), using driver: Apache Derby Embedded JDBC Driver 10.14.2.0 - (1828579) (10.14), connecting to: jdbc:derby:./target/derby-ds-test, transaction isolation level: TRANSACTION_READ_COMMITTED (2), SA.NODES: ID VARCHAR(512), MODIFIED BIGINT, HASBINARY SMALLINT, DELETEDONCE SMALLINT, MODCOUNT BIGINT, CMODCOUNT BIGINT, DSIZE BIGINT, VERSION SMALLINT, SDTYPE SMALLINT, SDMAXREVTIME BIGINT, DATA VARCHAR(16384), BDATA BLOB(1073741824) /* {BIGINT=-5, BLOB=2004, SMALLINT=5, VARCHAR=12} */ /* index NODES_MOD on SA.NODES (MODIFIED ASC) other (#0, p0), index NODES_SDM on SA.NODES (SDMAXREVTIME ASC) other (#0, p0), index NODES_SDT on SA.NODES (SDTYPE ASC) other (#0, p0), index NODES_VSN on SA.NODES (VERSION ASC) other (#0, p0), unique index SQL190131122022490 on SA.NODES (ID ASC) other (#0, p0) */
+12:20:22.705 INFO  [main] RDBDocumentStore.java:1070        Tables created upon startup: [CLUSTERNODES, NODES, SETTINGS, JOURNAL]
+~~~
+
+If it does not, the system will not start up and provide
 diagnostics in the log file.
 
 Administrators who want to create tables upfront can do so. The DDL statements
@@ -81,13 +92,35 @@ for the supported databases can be dumpe
 ## Upgrade from earlier versions
 
 As of Oak 1.8, the database layout has been slightly extended (see 
-[API docs for RDBDocumentStore](/oak/docs/apidocs/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.html)
+[API docs for RDBDocumentStore](/oak/docs/apidocs/org/apache/jackrabbit/oak/plugins/document/rdb/RDBDocumentStore.html#apidocs.versioning)
 for details).
 
 Upon startup on an "old" database instance, `RDBDocumentStore` will try to
-upgrade the tables. If this fails, it will continue using the "old" layout,
-and log diagnostics about the failed upgrade. The upgrade can then be done
-at a later point of time by executing the required DDL statements.
+upgrade the tables. Example (for `NODES`):
+
+~~~
+12:05:54.146 INFO  [main] RDBDocumentStore.java:1369        Upgraded NODES to DB level 1 using 'alter table NODES add VERSION smallint'
+
+12:05:54.166 INFO  [main] RDBDocumentStore.java:1369        Upgraded NODES to DB level 2 using 'alter table NODES add SDMAXREVTIME bigint'
+12:05:54.167 INFO  [main] RDBDocumentStore.java:1369        Upgraded NODES to DB level 2 using 'create index NODES_VSN on NODES (VERSION)'
+12:05:54.167 INFO  [main] RDBDocumentStore.java:1369        Upgraded NODES to DB level 2 using 'create index NODES_SDT on NODES (SDTYPE)'
+12:05:54.167 INFO  [main] RDBDocumentStore.java:1369        Upgraded NODES to DB level 2 using 'create index NODES_SDM on NODES (SDMAXREVTIME)'
+~~~
+
+If this fails, it will continue using the "old" layout,
+and log diagnostics about the failed upgrade:
+
+~~~
+12:05:56.746 INFO  [main] RDBDocumentStore.java:1379        Attempted to upgrade NODES to DB level 1 using 'alter table NODES add VERSION smallint', but failed with SQLException 'table alter statement rejected: alter table NODES add VERSION smallint' (code: 17/state: ABCDE) - will continue without.
+
+12:05:56.955 INFO  [main] RDBDocumentStore.java:1379        Attempted to upgrade NODES to DB level 2 using 'alter table NODES add SDTYPE smallint', but failed with SQLException 'table alter statement rejected: alter table NODES add SDTYPE smallint' (code: 17/state: ABCDE) - will continue without.
+12:05:56.955 INFO  [main] RDBDocumentStore.java:1379        Attempted to upgrade NODES to DB level 2 using 'alter table NODES add SDMAXREVTIME bigint', but failed with SQLException 'table alter statement rejected: alter table NODES add SDMAXREVTIME bigint' (code: 17/state: ABCDE) - will continue without.
+12:05:56.964 INFO  [main] RDBDocumentStore.java:1379        Attempted to upgrade NODES to DB level 2 using 'create index NODES_SDT on NODES (SDTYPE)', but failed with SQLException ''SDTYPE' is not a column in table or VTI 'NODES'.' (code: 20000/state: 42X14) - will continue without.
+12:05:56.964 INFO  [main] RDBDocumentStore.java:1379        Attempted to upgrade NODES to DB level 2 using 'create index NODES_SDM on NODES (SDMAXREVTIME)', but failed with SQLException ''SDMAXREVTIME' is not a column in table or VTI 'NODES'.' (code: 20000/state: 42X14) - will continue without.
+~~~
+
+The upgrade can then be done
+at a later point of time by executing the required DDL statements.