0
0
Fork 0
mirror of https://github.com/nextcloud/server.git synced 2025-03-04 03:57:28 +00:00
nextcloud_server/lib/private/DB
Louis Chemineau d3b4b21e29 fix: Initialize lastConnectionCheck after first connection
We are checking whether the DB connection is alive once every 30 seconds. But when we are lacking the last check time, we are skipping the check and reconnect logic. This is causing the reconnect logic to never fire in those cases.

It seems to me that "those cases", are actually always the case, as upon initialization, we are not using the proper connection name to store the time.

In the `connect()` logic, when `$this->_conn` is null, `$this->getConnectionName()` is returning `replica`, so `$this->lastConnectionCheck` will be equal to `['replica' => time()];`

60711ea4cf/lib/private/DB/Connection.php (L215-L221)

60711ea4cf/lib/private/DB/Connection.php (L891-L893)

2b6d7bf65f/doctrine/dbal/src/Connections/PrimaryReadReplicaConnection.php (L136-L139)

Then, if the connection name ends up as being 'primary', the reconnect logic is skipped:

60711ea4cf/lib/private/DB/Connection.php (L874-L880)

Follow-up of https://github.com/nextcloud/server/pull/41819

Signed-off-by: Louis Chemineau <louis@chmn.me>
2025-02-25 11:07:34 +00:00
..
Exceptions feat(db): add mapping for lock wait timeout 2024-05-29 11:10:43 +02:00
QueryBuilder fix: improve logic for ensuring join columns are selected for partitioned queries 2024-12-12 21:44:05 +00:00
Adapter.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
AdapterMySQL.php feat(dbal): add proper insert ignore conflict method for MySQL 2024-06-25 11:28:37 +02:00
AdapterOCI8.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
AdapterPgSql.php feat(db): remove workaround for pqsql 9.4 and older 2024-06-03 12:47:31 +02:00
AdapterSqlite.php feat(dbal): add proper insert ignore conflict method for SQLite 2024-06-25 16:21:01 +02:00
ArrayResult.php chore: Apply php:cs recommendations 2024-08-28 14:54:14 +02:00
BacktraceDebugStack.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
Connection.php fix: Initialize lastConnectionCheck after first connection 2025-02-25 11:07:34 +00:00
ConnectionAdapter.php feat: implement distributing partitioned queries over multiple shards 2024-08-28 14:54:14 +02:00
ConnectionFactory.php fix(ConvertType): Read dbtype in createConnectionParams and remove safeguard 2025-01-30 12:19:39 +01:00
DbDataCollector.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
MigrationException.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
MigrationService.php fix(migration): Correctly sort migrations by version number 2024-08-28 18:49:09 +00:00
Migrator.php fix: Run migration sql as statement so that the primary db node is used 2024-09-09 09:38:13 +00:00
MigratorExecuteSqlEvent.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
MissingColumnInformation.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
MissingIndexInformation.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
MissingPrimaryKeyInformation.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
MySqlTools.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
ObjectParameter.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
OCSqlitePlatform.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
OracleConnection.php fix(db): Use createSchemaManager() method as getSchemaManager() is deprecated 2024-07-19 11:21:11 +02:00
OracleMigrator.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
PgSqlTools.php fix(db): Use createSchemaManager() method as getSchemaManager() is deprecated 2024-07-19 11:21:11 +02:00
PreparedStatement.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
ResultAdapter.php fix(db): Fix internal calls to doctrine's fetch() methods 2024-07-19 11:21:12 +02:00
SchemaWrapper.php feat: implement distributing partitioned queries over multiple shards 2024-08-28 14:54:14 +02:00
SetTransactionIsolationLevel.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
SQLiteMigrator.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00
SQLiteSessionInit.php chore: Add SPDX header 2024-05-24 13:11:22 +02:00