Mathijs den Burger pushed to branch feature/create-content at cms-community / 
hippo-repository


Commits:
dfa6f279 by Ard Schrijvers at 2017-09-12T15:49:32+02:00
REPO-1811 Implement in-memory lock manager

- - - - -
4750450f by Ard Schrijvers at 2017-09-12T23:29:49+02:00
REPO-1811 To the RepositoryImpl add a Journal ConnectionHelper accessor

Via this Journal ConnectionHelper we can access the Journal DataSource
via the ConnectionHelperDataSourceAccessor.

Admittedly, a bit clumsy but we need access to the Journal DataSource
because we need to know whether we are dealing with a database *and*
whether we have a clustered setup : Only in that case, the lock mechanism
has to be upgraded from in memory locking to db base locking because
needs to be cluster wide

- - - - -
e0f19fab by Ard Schrijvers at 2017-09-12T23:33:43+02:00
REPO-1811 Support for a Database lock manager

The Database lock manager interaction is pretty much exactly the same
as the MemoryLockManager interaction. The biggest difference is that
the DbLockManager creates database based locks and the MemoryLockManager
creates MemoryLocks. Note that a DbLock is the same as the MemoryLock
but only contains a #destroy implementation that releases the database
lock.

The DbLockManager is still work in progress

- - - - -
1dba0d49 by Ard Schrijvers at 2017-09-13T14:44:56+02:00
REPO-1811 Fix the LockClusterTest setup

(still ignored but the setup failed since we do not allow SNS
below jcr:root any more)

- - - - -
92c914ef by Ard Schrijvers at 2017-09-14T14:29:52+02:00
REPO-1811 Support database locking

- - - - -
cbf14aed by Ard Schrijvers at 2017-09-19T15:16:45+02:00
REPO-1811 Support background jobs in the Memory or Db LockManager

- All the background jobs are run by a single thread
- By default they run every 5 seconds with an initial delay of 5 seconds
- Every background job is wrapped in a 'synchronized runnable' the 
synchronized
  on the LockManager instance: The reason for this is that we do not want
  background jobs to write concurrently to possibly the same records as
  other (background) jobs
- We have the following background jobs:
  1) UnlockStoppedThreadJanitor : releases database locks for records
     that were held by a thread that is not alive any more
  2) DbResetExpiredLocksJanitor : Resets all database rows which have
     expired locks (rows with status 'RUNNING' or 'ABORT' and 
expirationTime
     has passed
  3) DbLockRefresher: Refreshes the expiresTime of a lock to currentTime + 
refreshRateSeconds
  4) LockThreadInterrupter : Interrupts the Thread that holds the lock that has 
been marked 'ABORT'

- - - - -
441beff4 by Ard Schrijvers at 2017-09-19T16:54:14+02:00
REPO-1811 Make sure getLocks and isLocked works cluster wide in case of a 
database

- - - - -
d3d25849 by Ard Schrijvers at 2017-09-20T11:30:29+02:00
REPO-1811 Fix sql statement

- - - - -
5ab1e55f by Ard Schrijvers at 2017-09-20T11:33:54+02:00
REPO-1811 Extract abstract test and add an 'abort' test

- - - - -
4a939b29 by Ard Schrijvers at 2017-09-20T11:37:27+02:00
REPO-1811 merge from master

- - - - -
7027fce3 by Ard Schrijvers at 2017-09-20T13:41:57+02:00
REPO-1811 use getHoldCount() instead of protected access

- - - - -
0bf87cb5 by Ard Schrijvers at 2017-09-20T13:42:28+02:00
REPO-1811 improve feedback

- - - - -
a268b5e6 by Ard Schrijvers at 2017-09-20T13:42:50+02:00
REPO-1811 use getHoldCount() instead of protected access

- - - - -
dac8d9cc by Ard Schrijvers at 2017-09-20T13:43:20+02:00
REPO-1811 Fix abort statement

- - - - -
cc3e10d9 by Ard Schrijvers at 2017-09-20T15:02:27+02:00
REPO-1811 Encapsulate the localLocks object

Since localLocks is a hashmap, all access to it should be synchronized.
This can be easier achieved by encapsulating it and whenever needed by
other classes, return a new object containing the same locks

- - - - -
43f17029 by Ard Schrijvers at 2017-09-20T15:25:56+02:00
REPO-1811 Enhance abort tests

- - - - -
05143edd by Ard Schrijvers at 2017-09-20T17:10:43+02:00
REPO-1811 use auto closable in integration tests

- - - - -
62bd68c2 by Ard Schrijvers at 2017-09-20T17:11:14+02:00
REPO-1811 Correct the expiresTime parameter

- - - - -
f038ec5b by Ard Schrijvers at 2017-09-20T17:13:20+02:00
REPO-1811 Locks in status ABORT should also be refreshed

Namely if a lock is in status ABORT and the lock is for the *CLUSTER NODE*
on which the DbLockRefresher runs, then it means that on this cluster
node the Thread that should be aborted did not yet abort (for example
still busy with its job). All we can do is wait until that job finishes

- - - - -
591ff099 by Ard Schrijvers at 2017-09-20T17:13:43+02:00
REPO-1811 remove unneeded auto commit

- - - - -
8a6b58b3 by Ard Schrijvers at 2017-09-20T17:14:10+02:00
REPO-1811 If a Thread is already interrupted, don't interrupt again

- - - - -
a3bc5d1f by Ard Schrijvers at 2017-09-20T17:14:41+02:00
REPO-1811 Integration tests that confirm the correct working of the 
DbLockRefresher

- - - - -
c2284223 by Ard Schrijvers at 2017-09-27T14:01:46+02:00
REPO-1811 Tests to confirm lock expiration

Integration tests that confirm the correct working of the
DbResetExpiredLocksJanitor

- - - - -
e5673caf by Ard Schrijvers at 2017-09-27T14:02:47+02:00
REPO-1811 reintegrate changes from master

- - - - -
79490e41 by Ard Schrijvers at 2017-09-27T14:21:05+02:00
REPO-1811 only run expires db lock test in integration test

- - - - -
547542ef by Ard Schrijvers at 2017-09-27T16:29:14+02:00
REPO-1811 Fix test to have flexible logger node test

- - - - -
4fdb9278 by Ard Schrijvers at 2017-09-28T16:21:15+02:00
REPO-1811 Improve exception handling and logging

- - - - -
90891595 by Ard Schrijvers at 2017-10-03T14:01:12+02:00
REPO-1811 merge from master

- - - - -
7996a3f2 by Ate Douma at 2017-10-03T15:23:22+02:00
REPO-1840 align with HCM-219 changes to simplify the resource values 
serialization

- serialize resources during serialization of a source instead of afterwards 
via a PostProcessItem (CopyItem or BinaryItem)
- move the responsibility for serialization to the ModuleContext (to be invoked 
from the SourceSerializer)
- ModuleWriter and SourceSerializer explicitly (and thus only) use model 
implementation classes like ModuleImpl,
  DefinitionNodeImpl, DefinitionPropertyImpl, ValueImpl, etc. to no longer need 
to use awkward casts where it matters

(cherry picked from commit 5cc8a1fcb4d4bd138989c019748cd5f261cdffd6)
(cherry picked from commit 1292a189a691176c72e81b3fd6e84b04be061812)

- - - - -
5d434d43 by Ard Schrijvers at 2017-10-03T15:24:24+02:00
REPO-1811 merge from master

- - - - -
589c19b8 by Ard Schrijvers at 2017-10-03T16:46:06+02:00
REPO-1811 Improved destroy of the LockManager and other improvements

- - - - -
b51f32d9 by Ard Schrijvers at 2017-10-03T17:20:27+02:00
REPO-1811 Remove the 'refreshRateSeconds' logic

Just fixed 60 seconds refresh rate

- - - - -
04c17617 by Ard Schrijvers at 2017-10-04T14:22:02+02:00
REPO-1811 Deprecate JCR (hippo) locking

Note all usages of JCR Locking still need to be replaced

- - - - -
d85ce35b by Ard Schrijvers at 2017-10-05T11:13:25+02:00
REPO-1811 merge from master

- - - - -
8ddbbc21 by Ard Schrijvers at 2017-10-05T23:29:49+02:00
REPO-1811 Use the new LockManager instead of JCR Locking

- - - - -
ac0b839d by Ard Schrijvers at 2017-10-06T15:15:41+02:00
REPO-1811 Implement autocloseable LockResource and integration tests

- - - - -
6938d49c by Ard Schrijvers at 2017-10-06T15:15:58+02:00
REPO-1811 Use auto closeable

- - - - -
bb1f233b by Ard Schrijvers at 2017-10-08T23:34:43+02:00
REPO-1811 Add a cleanup background job that removes rows from database of old 
locks

- - - - -
e209d242 by Ard Schrijvers at 2017-10-08T23:42:53+02:00
REPO-1811 Implement new LockResource getters

- - - - -
ffb7b9a6 by Ard Schrijvers at 2017-10-08T23:53:51+02:00
REPO-1811 Better tearDown

Make sure tearDown with clearing the repository still removes
also the database entries because if they are kept, consequent runs can fail

- - - - -
87e1cb4b by Ard Schrijvers at 2017-10-08T23:54:32+02:00
REPO-1811 shorter keys

- - - - -
03072bf6 by Ard Schrijvers at 2017-10-09T23:29:38+02:00
REPO-1811 Support all databases and most specifically Oracle

- - - - -
16621623 by Ard Schrijvers at 2017-10-09T23:30:47+02:00
REPO-1811 merge from master

- - - - -
6354174b by Ard Schrijvers at 2017-10-13T14:29:47+02:00
REPO-1811 Handle the interrupted exception gracefully

When the lockmanager has an indication for 'abort' for the lock for the
thread that is executing the UpdateExecutor, it means, that the current
or a different cluster node has requested the task to be stopped. Invoking
#cancel is the graceful stop of the job

- - - - -
035c7ff9 by Ate Douma at 2017-10-15T23:19:39+02:00
REPO-1811 further refactoring and cleanup of the new (Db)LockManager

- construction moved to LocalHippoRepository as well as further generalized
- LockManagerFactory moved to DbLockManagerFactory and now only is responsible 
for constructing a DbLockManager
- DbLockManager: added support for schemaObjectPrefix and schemaCheckEnabled, 
like all JR schema definitions
- Added (handling for) new AlreadyLockedException, indicating a lock retry 
might be feasible
- Merged DbHelper logic into DbLockManager (which ittself now gets passed into 
background Runnables) and use JR ConnectionHelper to check if table already 
exists
- Replaced ConfigurationLockManager JR Locking with new LockManager
- Added LockManagerUtilsTest, in test module, for services-api provided 
LockManagerUtils

- - - - -
cf3a49af by Ard Schrijvers at 2017-10-16T12:20:51+02:00
REPO-1811 merge master changes

- - - - -
11f334ee by Ard Schrijvers at 2017-10-16T13:30:43+02:00
REPO-1811 Improve the logging statement

- - - - -
f81fb33e by Ard Schrijvers at 2017-10-16T13:31:27+02:00
REPO-1811 Make sure the lockThread finishes before tearDown kicks in

- - - - -
edf188a4 by Ard Schrijvers at 2017-10-16T21:36:12+02:00
REPO-1811 Merge branch 'feature/REPO-1811-2' into master

- - - - -
ab46d905 by Ard Schrijvers at 2017-10-16T21:47:01+02:00
REPO-1811 license header

- - - - -
84858ae4 by Ard Schrijvers at 2017-10-16T22:49:51+02:00
REPO-1811 fix unit tests

- - - - -
2d5ab607 by Peter Centgraf at 2017-10-19T09:20:29+02:00
REPO-1866 JCR-encode module name when updating last executed action in baseline

- - - - -
58cecd05 by Mathijs den Burger at 2017-10-20T10:21:25+02:00
REPO-1860 Merge master changes into feature/create-content

- - - - -


30 changed files:

- api/src/main/java/org/onehippo/repository/locking/HippoLock.java
- api/src/main/java/org/onehippo/repository/locking/HippoLockManager.java
- 
connector/src/main/java/org/hippoecm/repository/decorating/LockManagerDecorator.java
- + 
engine/src/main/java/org/apache/jackrabbit/core/journal/JournalConnectionHelperAccessorImpl.java
- + 
engine/src/main/java/org/apache/jackrabbit/core/util/db/ConnectionHelperDataSourceAccessor.java
- engine/src/main/java/org/hippoecm/repository/LocalHippoRepository.java
- engine/src/main/java/org/hippoecm/repository/impl/LockManagerDecorator.java
- engine/src/main/java/org/onehippo/cm/engine/ConfigurationBaselineService.java
- engine/src/main/java/org/onehippo/cm/engine/ConfigurationContentService.java
- engine/src/main/java/org/onehippo/cm/engine/ConfigurationLockManager.java
- engine/src/main/java/org/onehippo/cm/engine/ConfigurationServiceImpl.java
- + engine/src/main/java/org/onehippo/repository/lock/AbstractLockManager.java
- + engine/src/main/java/org/onehippo/repository/lock/InternalLockManager.java
- + engine/src/main/java/org/onehippo/repository/lock/MutableLock.java
- + 
engine/src/main/java/org/onehippo/repository/lock/db/DbLockCleanupJanitor.java
- + engine/src/main/java/org/onehippo/repository/lock/db/DbLockManager.java
- + 
engine/src/main/java/org/onehippo/repository/lock/db/DbLockManagerFactory.java
- + engine/src/main/java/org/onehippo/repository/lock/db/DbLockRefresher.java
- + 
engine/src/main/java/org/onehippo/repository/lock/db/DbResetExpiredLocksJanitor.java
- + 
engine/src/main/java/org/onehippo/repository/lock/db/LockThreadInterrupter.java
- + 
engine/src/main/java/org/onehippo/repository/lock/db/OracleDbLockManager.java
- + 
engine/src/main/java/org/onehippo/repository/lock/memory/MemoryLockManager.java
- 
engine/src/main/java/org/onehippo/repository/update/UpdaterExecutionModule.java
- engine/src/main/java/org/onehippo/repository/update/UpdaterExecutor.java
- 
engine/src/test/java/org/onehippo/cm/engine/BaseConfigurationConfigServiceTest.java
- 
engine/src/test/java/org/onehippo/cm/engine/ConfigurationBaselineServiceTest.java
- + engine/src/test/java/org/onehippo/repository/lock/MemoryLockManagerTest.java
- modules/src/main/java/org/hippoecm/repository/logging/RepositoryLogger.java
- test/config/h2-repository.xml
- test/config/mysql-repository.xml


The diff was not included because it is too large.


View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-repository/compare/a5658661c6c7d82cfe12482412c68b534d85d869...58cecd054c8eb6bfde0c4e2c3156ee2ad9fd4a16

---
View it on GitLab: 
https://code.onehippo.org/cms-community/hippo-repository/compare/a5658661c6c7d82cfe12482412c68b534d85d869...58cecd054c8eb6bfde0c4e2c3156ee2ad9fd4a16
You're receiving this email because of your account on code.onehippo.org.
_______________________________________________
Hippocms-svn mailing list
Hippocms-svn@lists.onehippo.org
https://lists.onehippo.org/mailman/listinfo/hippocms-svn

Reply via email to