Commit Graph

376 Commits (master)

Author SHA1 Message Date
John Molakvoæ 258bb03cf5
Merge branch 'master' into refactor/OC-Server-getSecureRandom
Signed-off-by: John Molakvoæ <skjnldsv@users.noreply.github.com>
3 days ago
Daniel Kesselberg 3fb0aa40cd
feat(db): add mapping for lock wait timeout
Signed-off-by: Daniel Kesselberg <mail@danielkesselberg.de>
4 days ago
Christoph Wurst 3bfba2042c
fix(db): Prevent two connections for single node databases
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 days ago
Thomas Citharel b0f5c759a8
Merge pull request #39589 from nextcloud/enh/set-nest-transactions-with-savepoints
set Doctrine to use nest transactions with savepoints
6 days ago
Josh 48b47f7903
fix(db): Log loong transaction times at debug level
Signed-off-by: Josh <josh.t.richards@gmail.com>
1 week ago
Andy Scherzinger dae7c159f7
chore: Add SPDX header
Signed-off-by: Andy Scherzinger <info@andy-scherzinger.de>
1 week ago
John Molakvoæ d4a6a700da
Merge pull request #39247 from nextcloud/query-log-backtrace 1 month ago
Robin Appelman d6be80ceaf
feat: add option to add backtrace to the query logger
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 month ago
Joas Schilling 90ba7db0fb
fix(querybuilder): Remove temporary internal method executeUpdate()
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 month ago
Côme Chilliet 26c4ca264f
fix: Remove bogus code from query builder and fix parameter name
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
1 month ago
Robin Appelman 8c10c78099
feat: add request id as comment to all queries
Signed-off-by: Robin Appelman <robin@icewind.nl>
2 months ago
Git'Fellow 5f519a2e7d
chore(db): move to OCP\Server
Signed-off-by: Git'Fellow <12234510+solracsf@users.noreply.github.com>
2 months ago
Côme Chilliet ab6afe0111 fix: Fix new psalm errors from update
Not sure about the SimpleContainer modification, let’s see what CI says
 about that.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2 months ago
Côme Chilliet ec5133b739 fix: Apply new coding standard to all files
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
2 months ago
Benjamin Gaussorgues b304dc78f8
Merge pull request #44470 from nextcloud/fix/compatibility-replica-splitting 2 months ago
Julius Härtl 2fdb9184fa
fix: Allow using replica config with split databases
Signed-off-by: Julius Härtl <jus@bitgrid.net>
2 months ago
Ferdinand Thiessen 2525e73caa fix(DB): Sanitize `host` parameter for postgres databases when IPv6 address is passed
Doctrine is using `pg_connect` with the `host` parameter, this does not allow IPv6 addresses in URI notation.
So we need to extract the IP address and pass it directly

Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
2 months ago
Thomas Citharel 2a0815401e feat(db): set Doctrine to use nest transactions with savepoints
Using nested transactions without savepoints is actually deprecated by Doctrine:
https://www.doctrine-project.org/projects/doctrine-dbal/en/current/reference/transactions.html#transaction-nesting

Without savepoints, a nested transaction can be rollbacked but not
handled properly in the "real" transaction, leading to the following
error:
Transaction commit failed because the transaction has been marked for rollback only.

Ref
https://github.com/nextcloud/server/pull/36528#issuecomment-1639913965
(and possibly) https://github.com/nextcloud/server/issues/38902#issuecomment-1598075391

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
3 months ago
Christoph Wurst d52ebaa7cd
Merge pull request #43297 from nextcloud/fix/db/dirty-read-cool-off
fix(db): Let dirty writes cool off
3 months ago
Christoph Wurst 1f46e4b854
fix(db): Let dirty writes cool off
We can assume that after a few seconds a read will be clean again.
This is helpful for false warnings in long running processes.

Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
3 months ago
Christoph Wurst cf17a20835 fix(db): Give dirty read exception a message
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 months ago
Christoph Wurst aef28e191a
fix(db): Unify long transaction log/exception message
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 months ago
Simon L 8fd2289058
Merge pull request #43357 from nextcloud/enh/41253/fix-occ-upgrade
fix(migration): Make naming constraint fail softer on updates
4 months ago
Louis Chemineau 898df41de9
Revert "Merge branch 'master' of github.com:nextcloud/server"
This reverts commit d9d60238c7, reversing
changes made to ba3fdb0cdc.
4 months ago
Joas Schilling 487c33f479
fix(migration): Make naming constraint fail softer on updates
Only on installation we want to break hard, so that all developers notice
the bugs when installing the app on any database or CI, and can work on
fixing their migrations before releasing a version incompatible with Postgres.

In case of updates we might be running on production instances and the
administrators being faced with the error would not know how to resolve it
anyway. This can also happen with instances, that had the issue before the
current update, so we don't want to make their life more complicated
than needed.

Signed-off-by: Joas Schilling <coding@schilljs.com>
4 months ago
Christoph Wurst 97152de9bf
fix(db): Execute dirty reads on the primary node
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 months ago
Christoph Wurst 911ab393c0
feat(db): Make dirty query logging available in production
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
4 months ago
Christoph Wurst 033a654389
Merge pull request #42929 from nextcloud/fix/db/transacted-read-not-dirty
fix(db): Do not log transacted reads as dirty read
4 months ago
Christoph Wurst ab0d7c007d fix(db): Remove very verbose dirty query logs
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 months ago
Christoph Wurst f54b08c224
fix(db): Do not log transacted reads as dirty read
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
5 months ago
Julius Härtl 296096e069
fix: Add reconnect check in case of timeouts on the db side
Signed-off-by: Julius Härtl <jus@bitgrid.net>
5 months ago
Julius Härtl c17c42a0b2 feat: First attempt to track dirty tables after writes and switch back to replicas if reads go to other tables
Signed-off-by: Julius Härtl <jus@bitgrid.net>

debug: error log

Signed-off-by: Julius Härtl <jus@bitgrid.net>
5 months ago
Julius Härtl 3e60092b7d feat: Add logging for transaction time
Signed-off-by: Julius Härtl <jus@bitgrid.net>
5 months ago
Julius Härtl 86dc766276 Cast datetime columns in sqlite before comparing
Move the logic to prepare a column to the parent ExpressionBuilder so
that it can be reused for OCI and sqlite

Signed-off-by: Julius Härtl <jus@bitgrid.net>
5 months ago
Julius Härtl 79c4986354
enh: Implement PrimaryReadReplicaConnection
Signed-off-by: Julius Härtl <jus@bitgrid.net>
6 months ago
Côme Chilliet 1b547c7db8 Migrate missing primary key database check to new API
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
6 months ago
Côme Chilliet ad88c04f2d Migrate missing index database check to new API
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
6 months ago
Côme Chilliet 2cb1c0f2dc Migrate missing column database check to new API
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
6 months ago
Joas Schilling aa5f037af7
chore: apply changes from Nextcloud coding standards 1.1.1
Signed-off-by: Joas Schilling <coding@schilljs.com>
Signed-off-by: Benjamin Gaussorgues <benjamin.gaussorgues@nextcloud.com>
6 months ago
Arthur Schiwon 93505b2cdd fix(workflowengine): use andWhere() not second where()
- an unconditional where() condition is added right before
- fixes also wrongly named methods in the Exception message

Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
7 months ago
Joas Schilling 6f39d82031
fix(install): Make installing more verbose
Signed-off-by: Joas Schilling <coding@schilljs.com>
7 months ago
Joas Schilling 15a7aa51c5
fix(dbal): Fix types in query builder methods for parameters
Signed-off-by: Joas Schilling <coding@schilljs.com>
8 months ago
Joas Schilling 570159e610
fix(DB): Update comment to state why we still use the max 4k limit
Signed-off-by: Joas Schilling <coding@schilljs.com>
8 months ago
Joas Schilling ccb01b19a0
fix(sqlite): Remove some old SQLite cheats
- Doctrine correctly forces integer for autoincrement by now
- Doctrine correctly maintains integer types by now

Signed-off-by: Joas Schilling <coding@schilljs.com>
8 months ago
Joas Schilling f8ee6c4769
fix(oracle): Move away from internal and deprecated SchemaDiff API
Signed-off-by: Joas Schilling <coding@schilljs.com>
8 months ago
Joas Schilling 919207873e
fix(dbal): Move migrator away from deprecated calls
Signed-off-by: Joas Schilling <coding@schilljs.com>
8 months ago
Joas Schilling 160298c556
fix(mysql): Remove custom MySQL workaround from 2015
Signed-off-by: Joas Schilling <coding@schilljs.com>
8 months ago
Joas Schilling b202b139dd
fix(postgres): Remove old Postgres 9.4 workaround
Postgres 10 is the minimum in the meantime
and doctrine/dbal fixed this in 2.6.0 already
ref https://github.com/doctrine/dbal/pull/2614

Signed-off-by: Joas Schilling <coding@schilljs.com>
8 months ago
Joas Schilling ad839dbb0a
fix(sqlite): Remove no longer required autoincrement fix
- I installed current master and exported the schema as SQL
- Then I went to this branch, removed the content of the run() method (so made it no-op)
- I installed again and exported the schema as SQL
- The files are exactly the same, so whatever we tried to fix was fixed since 2015 in doctrine dbal

Signed-off-by: Joas Schilling <coding@schilljs.com>
8 months ago
Hamid Dehnavi ea06cf2f39 Convert isset ternary to null coalescing operator
Signed-off-by: Hamid Dehnavi <hamid.dev.pro@gmail.com>
8 months ago