aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands')
-rw-r--r--src/backend/commands/dbcommands.c26
-rw-r--r--src/backend/commands/tablespace.c30
2 files changed, 4 insertions, 52 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);
diff --git a/src/backend/commands/tablespace.c b/src/backend/commands/tablespace.c
index 1eaa0abeea2..2ff3835ab0f 100644
--- a/src/backend/commands/tablespace.c
+++ b/src/backend/commands/tablespace.c
@@ -40,7 +40,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.71 2010/01/12 02:42:51 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/commands/tablespace.c,v 1.72 2010/01/14 11:08:01 sriggs Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1377,33 +1377,7 @@ tblspc_redo(XLogRecPtr lsn, XLogRecord *record)
*/
if (!destroy_tablespace_directories(xlrec->ts_id, true))
{
- VirtualTransactionId *temp_file_users;
-
- /*
- * Standby users may be currently using this tablespace for
- * for their temporary files. We only care about current
- * users because temp_tablespace parameter will just ignore
- * tablespaces that no longer exist.
- *
- * Ask everybody to cancel their queries immediately so
- * we can ensure no temp files remain and we can remove the
- * tablespace. Nuke the entire site from orbit, it's the only
- * way to be sure.
- *
- * XXX: We could work out the pids of active backends
- * using this tablespace by examining the temp filenames in the
- * directory. We would then convert the pids into VirtualXIDs
- * before attempting to cancel them.
- *
- * We don't wait for commit because drop tablespace is
- * non-transactional.
- */
- temp_file_users = GetConflictingVirtualXIDs(InvalidTransactionId,
- InvalidOid,
- false);
- ResolveRecoveryConflictWithVirtualXIDs(temp_file_users,
- "drop tablespace",
- CONFLICT_MODE_ERROR);
+ ResolveRecoveryConflictWithTablespace(xlrec->ts_id);
/*
* If we did recovery processing then hopefully the