Skip to content

Commit 03c3503

Browse files
committed
[ignore] Update conf files for testing lock configuration
1 parent 4e7a189 commit 03c3503

File tree

8 files changed

+1277
-285
lines changed
  • exist-core/src/test/resources-filtered
  • extensions/indexes
    • lucene/src/test/resources-filtered
    • ngram/src/test/resources-filtered
    • range/src/test/resources-filtered
    • sort/src/test/resources-filtered
    • spatial/src/test/resources-filtered

8 files changed

+1277
-285
lines changed

exist-core/src/test/resources-filtered/conf.xml

Lines changed: 167 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,10 @@
3535
startup
3636
triggers
3737
pool
38+
query-pool
3839
recovery
39-
security
4040
watchdog
41+
lock-manager
4142
repository
4243
binary-manager
4344
indexer
@@ -74,9 +75,6 @@
7475
7576
- http://exist-db.org/exist/apps/doc/configuration.xml
7677
- http://exist-db.org/exist/apps/doc/documentation.xml
77-
- http://atomic.exist-db.org/
78-
79-
Version: 3.3.0-SNAPSHOT
8078
8179
-->
8280
<exist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="schema/conf.xsd">
@@ -148,27 +146,55 @@
148146
with high load will never be shrinked. A negative value means that
149147
shrinkage will not be performed.
150148
151-
- doc-ids:
152-
how document ids are managed by eXist. Takes the values
153-
"default" or "incremental".
154-
155-
eXist assigns a unique, 32bit integer document id to every
156-
document. When a document is deleted, its id will be freed
157-
and reused for the next document stored. The disadvantage
158-
of this approach is that document ids
159-
are not stable, i.e. one cannot be sure that the same document
160-
id will always identify the same document.
161-
162-
If you need stable, incremental ids, set the option doc-ids to
163-
"incremental".
164149
- minDiskSpace:
165150
The amount of disk space (in megabytes) which should be available for
166151
the database to continue operations. If free disk space goes below
167152
the configured limit, eXist-db will flush all buffers to disk and
168153
switch to read-only mode in order to prevent potential data loss.
169154
Set the limit large enough to allow all pending operations to
170155
complete. Set to -1 to disable. The default is 1 gigabyte.
171-
156+
157+
- posix-chown-restricted:
158+
As defined by POSIX.1 for _POSIX_CHOWN_RESTRICTED.
159+
160+
When posix-chown-restricted="true" (the default) then:
161+
1. Only a superuser process can change the user ID of the file.
162+
2. A non-superuser process can change the group ID of the file
163+
if the process owns the file (the effective user ID equals
164+
the user ID of the file), and group equals either the
165+
effective group ID of the process or one of the
166+
process’s supplementary group IDs.
167+
This means that when posix-chown-restricted="true", you can’t change
168+
the user ID of your files. You can change the group ID of files that
169+
you own, but only to groups that you belong to.
170+
171+
When posix-chown-restricted="false" you can change the user ID of
172+
any file that you own, effectively "giving away the file" to
173+
another user. Such a setting has negative security implications,
174+
further details can be seen in the "Rationale" section for the
175+
chown function in the POSIX.1-2017 (Issue 7, 2018 edition) standard.
176+
See: http://pubs.opengroup.org/onlinepubs/9699919799/functions/chown.html#tag_16_59_07
177+
178+
- preserve-on-copy
179+
When copying Collections and Documents within the database, the
180+
default (`false`), is not to preserve their attributes
181+
(modification time, mode, user-id, group-id, and ACL).
182+
183+
NOTE: Not preserving attributes, is inline with both the GNU and
184+
BSD `cp` commands, and therefore expected behaviour; The target
185+
Collection or Document is created following the rules of the
186+
target parent, and the effective user and their umask.
187+
188+
Setting preserve-on-copy="true" changes the default behaviour
189+
so that the target Collection or Document of a copy, has the same
190+
attributes as the source.
191+
192+
The preserve-on-copy setting can be overridden on a case-by-case
193+
basis by setting the `preserve` flag to either `true` or `false`
194+
when calling xmldb:copy(), or via any other API that supports copy.
195+
Omitting the preserve flag when calling a copy operation, implies
196+
the behaviour that is set in this configuration.
197+
172198
=====================================================================
173199
174200
The settings below are very conservative to avoid out-of-memory
@@ -180,18 +206,19 @@
180206
-->
181207
<db-connection cacheSize="256M" checkMaxCacheSize="true" collectionCache="64M" database="native"
182208
files="${basedir}/target/test-data" pageSize="4096" nodesBuffer="1000" cacheShrinkThreshold="10000"
183-
doc-ids="default" minDiskSpace="1024M">
209+
minDiskSpace="1024M" posix-chown-restricted="true" preserve-on-copy="false">
184210

185211
<!--
186212
Startup Triggers are executed before the database becomes generally available
187213
for service and have complete access to the database as the SYSTEM broker
188214
-->
189215
<startup>
190216
<triggers>
191-
<!--
192-
Trigger for registering the GNU Crypto JCE Provider with Java
193-
-->
194-
<trigger class="org.exist.security.BouncyCastleJceProviderStartupTrigger"/>
217+
218+
<!--
219+
Trigger for registering the GNU Crypto JCE Provider with Java
220+
-->
221+
<trigger class="org.exist.security.BouncyCastleJceProviderStartupTrigger"/>
195222

196223
<!--
197224
Trigger for registering eXists XML:DB URL handler with Java
@@ -247,15 +274,9 @@
247274
by threads, each thread needs a private copy of a query.
248275
249276
- timeout:
250-
amount of time that a query will be cached in the query-pool.
251-
252-
- timeout-check-interval:
253-
time between checking for timed out queries. For value "-1"
254-
the time out is switched off, resulting cached queries to remain
255-
in the cache forever.
277+
amount of time that a query will be cached in the query-pool in milliseconds.
256278
-->
257-
<query-pool max-stack-size="64" size="128" timeout="120000"
258-
timeout-check-interval="30000"/>
279+
<query-pool max-stack-size="64" size="128" timeout="120000"/>
259280

260281
<!--
261282
Settings for the journaling and recovery of the database. With
@@ -353,6 +374,92 @@
353374

354375
</db-connection>
355376

377+
378+
<!--
379+
Settings for the Database Lock Manager
380+
381+
- upgrade-check
382+
Used by developers for diagnosing illegal lock upgrade issues. When enabled
383+
checks for lock upgrading within the same thread, i.e. READ_LOCK -> WRITE_LOCK
384+
are enabled. When an illegal upgrade is detected a LockException is thrown.
385+
Such behaviour will likely corrupt any database writes, and should only be
386+
used by developers when debugging database issues.
387+
388+
This can also be set via the Java System Properties `org.exist.lock-manager.upgrade-check`,
389+
or (legacy) `exist.lockmanager.upgrade.check`.
390+
391+
- warn-wait-on-read-for-write
392+
Used by developers for diagnosing lock performance issues. When enabled
393+
checks for detecting when a thread wants to acquire the WRITE_LOCK
394+
but another thread holds the READ_LOCK are enabled. When such operations
395+
are detected a log message is written to locks.log at WARN level.
396+
397+
This can also be set via the Java System Properties `org.exist.lock-manager.warn-wait-on-read-for-write`,
398+
or (legacy) `exist.lockmanager.warn.waitonreadforwrite`.
399+
400+
- paths-multi-writer
401+
Set to true to enable Multi-Writer/Multi-Reader semantics for
402+
the database Collection/Document Hierarchy as opposed to the default (false)
403+
for Single-Writer/Multi-Reader.
404+
405+
NOTE: Whilst enabling Multiple-Writers on the Collection and Document Hierarchy can improve concurrent
406+
through-put for write-heavy workloads, it can also can lead to deadlocks unless the User's
407+
Collection Hierarchy is carefully designed to isolate query/database writes between Collection combs.
408+
It is highly recommended that users leave this as the default setting. For more information, see:
409+
"Locking and Cache Improvements for eXist-db", 2018-02-05, Section "Attempt 6" Page 58 -
410+
https://www.evolvedbinary.com/technical-reports/exist-db/locking-and-cache-improvements/
411+
412+
This can also be set via the Java System Properties `org.exist.lock-manager.paths-multiple-writers`,
413+
or (legacy) `exist.lockmanager.paths-multiwriter`.
414+
-->
415+
<lock-manager
416+
upgrade-check="false"
417+
warn-wait-on-read-for-write="false"
418+
paths-multi-writer="false">
419+
420+
<!--
421+
Settings for the Lock Table
422+
423+
- disabled
424+
Disables the database lock table which tracks database locks. The Lock Table is enabled by default
425+
and allows reporting on database locking via JMX.
426+
427+
NOTE: Tracking locks via the Lock Table imposes a small overhead per-Lock. Once users
428+
have finished testing their system to ensure correct operation, they may wish to disable
429+
this in production to ensure the absolute best performance.
430+
431+
This can also be set via the Java System Properties `org.exist.lock-manager.lock-table.disabled`,
432+
or (legacy) `exist.locktable.disable`.
433+
434+
- trace-stack-depth
435+
When set above 0, this captures n frames of each threads stack that performs a try/lock/release
436+
operation. These frames are visible from JMX reporting.
437+
In addition, when the logging level for the Lock Table is set in log4j2.xml to TRACE the lock
438+
events are written to the locks.log file.
439+
440+
This can also be set via the Java System Properties `org.exist.lock-manager.lock-table.trace-stack-depth`,
441+
or (legacy) `exist.locktable.trace.stack.depth`.
442+
-->
443+
<lock-table disabled="false" trace-stack-depth="0"/>
444+
445+
446+
<!-- Settings for Document Locking
447+
448+
- use-path-locks
449+
Set to true to have documents participate in the same hierarchical
450+
path based locking strategy as Collections.
451+
452+
This has a performance and concurrency impact, but will ensure
453+
that you cannot have deadlocks between Collections and Documents.
454+
455+
NOTE: in future this will likely be set to `true` by default.
456+
457+
This can also be set via the Java System Property `org.exist.lock-manager.document.use-path-locks`.
458+
-->
459+
<document use-path-locks="false"/>
460+
461+
</lock-manager>
462+
356463
<!--
357464
Settings for the package repository:
358465
@@ -542,6 +649,18 @@
542649
<!--
543650
Default settings for parsing structured documents:
544651
652+
- xml (optional)
653+
654+
- features
655+
Any default SAX2 feature flags to set on the parser
656+
657+
- feature
658+
- name
659+
the name of the feature flag
660+
- value
661+
the value of the feature flag
662+
663+
545664
- html-to-xml (optional)
546665
547666
- class
@@ -579,6 +698,22 @@
579698
-->
580699
<parser>
581700

701+
<xml>
702+
703+
<features>
704+
705+
<!-- NOTE: the following feature flags should likely be set in production to ensure a secure environment -->
706+
707+
<!--
708+
<feature name="http://xml.org/sax/features/external-general-entities" value="false"/>
709+
<feature name="http://xml.org/sax/features/external-parameter-entities" value="false"/>
710+
<feature name="http://javax.xml.XMLConstants/feature/secure-processing" value="true"/>
711+
-->
712+
713+
</features>
714+
715+
</xml>
716+
582717
<!-- html-to-xml class="org.ccil.cowan.tagsoup.Parser"/ -->
583718

584719
<html-to-xml class="org.cyberneko.html.parsers.SAXParser">
@@ -750,7 +885,7 @@
750885
enable-query-rewriting="yes" backwardCompatible="no"
751886
enforce-index-use="always"
752887
raise-error-on-failed-retrieval="no">
753-
888+
754889
<builtin-modules>
755890
<module uri="http://www.w3.org/2005/xpath-functions/map" class="org.exist.xquery.functions.map.MapModule" />
756891
<module uri="http://www.w3.org/2005/xpath-functions/math" class="org.exist.xquery.functions.math.MathModule" />

0 commit comments

Comments
 (0)