aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/dbcommands.c
diff options
context:
space:
mode:
authorSimon Riggs <simon@2ndQuadrant.com>2010-01-14 11:08:02 +0000
committerSimon Riggs <simon@2ndQuadrant.com>2010-01-14 11:08:02 +0000
commite99767bc28d8ef9ea627cd63336b2b74087c0128 (patch)
tree29cae5f633b1ede8d959daec86aa2bb40170326d /src/backend/commands/dbcommands.c
parent0fba3bef558036952f59846a7e7b48e1f5b9e479 (diff)
downloadpostgresql-e99767bc28d8ef9ea627cd63336b2b74087c0128.tar.gz
postgresql-e99767bc28d8ef9ea627cd63336b2b74087c0128.zip
First part of refactoring of code for ResolveRecoveryConflict. Purposes
of this are to centralise the conflict code to allow further change, as well as to allow passing through the full reason for the conflict through to the conflicting backends. Backend state alters how we can handle different types of conflict so this is now required. As originally suggested by Heikki, no longer optional.
Diffstat (limited to 'src/backend/commands/dbcommands.c')
-rw-r--r--src/backend/commands/dbcommands.c26
1 files changed, 2 insertions, 24 deletions
diff --git a/src/backend/commands/dbcommands.c b/src/backend/commands/dbcommands.c
index 846f59244b4..a45b351dd54 100644
--- a/src/backend/commands/dbcommands.c
+++ b/src/backend/commands/dbcommands.c
@@ -13,7 +13,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.231 2010/01/10 15:44:28 sriggs Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/dbcommands.c,v 1.232 2010/01/14 11:08:00 sriggs Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1944,29 +1944,7 @@ dbase_redo(XLogRecPtr lsn, XLogRecord *record)
dst_path = GetDatabasePath(xlrec->db_id, xlrec->tablespace_id);
if (InHotStandby)
- {
- /*
- * We don't do ResolveRecoveryConflictWithVirutalXIDs() here since
- * that only waits for transactions and completely idle sessions
- * would block us. This is rare enough that we do this as simply
- * as possible: no wait, just force them off immediately.
- *
- * No locking is required here because we already acquired
- * AccessExclusiveLock. Anybody trying to connect while we do this
- * will block during InitPostgres() and then disconnect when they
- * see the database has been removed.
- */
- while (CountDBBackends(xlrec->db_id) > 0)
- {
- CancelDBBackends(xlrec->db_id);
-
- /*
- * Wait awhile for them to die so that we avoid flooding an
- * unresponsive backend when system is heavily loaded.
- */
- pg_usleep(10000);
- }
- }
+ ResolveRecoveryConflictWithDatabase(xlrec->db_id);
/* Drop pages for this database that are in the shared buffer cache */
DropDatabaseBuffers(xlrec->db_id);