From:
Andres Freund <andres(at)2ndquadrant(dot)com>
To:
Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc:
Greg Stark <stark(at)mit(dot)edu>,
pgsql-hackers(at)postgresql(dot)org,
Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
Subject:
Re: Support for REINDEX CONCURRENTLY
Date:
2012-10-03 14:52:17
Message-ID:
201210031652.18021.andres@2ndquadrant.com (view raw or flat )
Thread:
2012-10-03 01:14:17 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-10-03 07:48:43 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-10-03 08:10:52 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-10-03 08:27:46 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-10-03 08:33:31 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-10-03 10:59:25 from Greg Stark <stark(at)mit(dot)edu>
2012-10-03 11:08:24 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-10-03 11:15:27 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-10-03 11:22:22 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-10-03 14:28:59 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-10-03 14:52:17 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-10-03 20:12:58 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-10-03 20:41:36 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-10-03 21:42:25 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-10-03 21:53:52 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-10-03 23:27:02 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-10-04 01:00:27 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-10-04 01:19:02 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-10-04 02:31:45 from Greg Stark <stark(at)mit(dot)edu>
2012-10-04 02:51:29 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-10-04 05:03:24 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-10-04 21:58:16 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-10-05 00:33:56 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-10-05 20:03:29 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-10-05 21:07:03 from Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
2012-10-05 21:14:02 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-10-05 23:12:59 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-10-05 23:40:45 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-10-06 02:57:24 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-10-08 21:57:46 from Jim Nasby <jim(at)nasby(dot)net>
2012-10-08 22:08:38 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-10-08 23:14:06 from Jim Nasby <jim(at)nasby(dot)net>
2012-10-09 01:19:16 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-10-08 23:12:37 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-10-08 23:16:30 from Jim Nasby <jim(at)nasby(dot)net>
2012-10-12 18:17:41 from Stephen Frost <sfrost(at)snowman(dot)net>
2012-10-13 02:50:44 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-12-07 12:37:06 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-12-07 13:33:21 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-12-07 17:01:52 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-12-07 17:19:31 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-12-07 18:17:48 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-12-08 12:24:47 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-12-08 13:37:30 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-12-08 14:40:43 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-12-08 14:55:12 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-12-08 15:14:17 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-12-09 17:15:16 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-12-09 17:29:05 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-12-10 06:03:59 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-12-10 09:28:51 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-12-10 11:26:17 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-12-10 15:48:27 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2012-12-10 14:51:40 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-12-10 15:28:56 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-12-17 02:44:00 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-12-19 02:24:55 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-01-15 09:16:59 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-01-16 06:33:15 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-01-23 18:41:34 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-01-23 18:45:11 from Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
2013-01-23 18:53:41 from Gavin Flower <GavinFlower(at)archidevsys(dot)co(dot)nz>
2013-01-24 18:29:56 from Robert Haas <robertmhaas(at)gmail(dot)com>
2013-01-24 18:34:33 from Bruce Momjian <bruce(at)momjian(dot)us>
2013-01-24 18:45:08 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-01-24 18:48:35 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-01-25 04:48:50 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-01-26 16:52:35 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-01-26 22:54:43 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-01-28 10:39:16 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-01-28 11:31:48 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-01-28 11:44:14 from Andres Freund <andres(at)anarazel(dot)de>
2013-01-28 11:50:21 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-01-28 11:59:41 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-01-28 14:24:29 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-07 07:45:57 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-07 07:55:38 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-02-07 08:01:36 from Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
2013-02-07 08:15:16 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-02-07 08:28:53 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-12 11:47:13 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-02-12 12:54:52 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-12 13:04:18 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-02-12 13:19:41 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-13 06:55:23 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-14 07:08:42 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-19 15:14:52 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-02-21 02:55:54 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-22 17:14:20 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-02-25 02:59:51 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-28 06:21:49 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-28 07:56:24 from "anarazel(at)anarazel(dot)de" <andres(at)anarazel(dot)de>
2013-02-28 08:00:00 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-28 14:26:40 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-01 03:57:35 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-01 17:43:58 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-01 19:42:24 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-01 21:32:19 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2013-03-03 12:54:36 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-03-04 08:21:09 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-04 13:33:53 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-05 09:27:59 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-03-05 13:35:16 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-05 14:22:14 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-06 00:07:03 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-05 16:49:51 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-03-06 04:21:27 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-06 08:50:39 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-03-06 11:59:37 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-06 12:09:43 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-03-06 12:19:57 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-06 12:31:37 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-03-06 17:09:49 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-06 17:17:19 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-03-06 17:34:54 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-06 17:54:04 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-03-06 20:26:31 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-06 22:19:56 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-03-07 00:48:35 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-07 00:58:58 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-07 16:46:02 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-03-09 18:55:55 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-07 16:41:20 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-08 13:00:52 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-08 16:37:34 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-09 04:31:28 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-09 18:48:00 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-09 19:50:15 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-10 04:46:27 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-10 05:18:43 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-13 12:04:48 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-16 15:35:54 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-16 18:31:44 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-17 12:24:16 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-18 18:03:35 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-18 23:54:40 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-19 00:09:43 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-21 22:38:36 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-23 03:11:49 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-23 13:20:28 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-03-24 03:37:34 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-26 18:05:39 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-26 23:26:13 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-27 18:12:15 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-28 01:18:45 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-28 01:34:06 from Andres Freund <andres(at)anarazel(dot)de>
2013-03-28 13:12:26 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-31 07:40:28 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-06-06 04:29:41 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-06-16 19:20:03 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-06-16 20:23:44 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-06-17 12:23:36 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-06-17 13:12:12 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2013-06-17 13:19:13 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-06-17 15:03:35 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2013-06-17 15:14:45 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-06-17 19:52:36 from Josh Berkus <josh(at)agliodbs(dot)com>
2013-06-17 20:00:05 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-06-17 20:40:01 from Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
2013-06-17 20:46:07 from Josh Berkus <josh(at)agliodbs(dot)com>
2013-06-17 20:54:40 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-06-17 18:26:38 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-06-18 01:53:25 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-06-18 09:35:10 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-06-18 12:54:52 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-06-18 15:37:20 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-06-18 15:36:28 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-18 18:24:34 from Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
2013-03-18 23:57:31 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-03-28 01:35:40 from Andres Freund <andres(at)anarazel(dot)de>
2013-03-06 19:38:45 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-07 08:15:51 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-07 08:12:51 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-02-12 12:13:24 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-01-25 05:11:39 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2013-01-26 16:37:23 from Andres Freund <andres(at)2ndquadrant(dot)com>
2013-01-26 22:36:08 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-12-11 00:47:30 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-12-10 22:18:53 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2012-12-10 22:21:21 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-12-10 22:27:45 from Peter Eisentraut <peter_e(at)gmx(dot)net>
2012-12-10 22:33:50 from Simon Riggs <simon(at)2ndQuadrant(dot)com>
2012-12-10 22:42:25 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-12-10 22:39:42 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-12-11 20:23:52 from Robert Haas <robertmhaas(at)gmail(dot)com>
2012-12-11 20:27:11 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-12-08 12:31:13 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-12-08 12:22:13 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-12-07 15:55:17 from Andres Freund <andres(at)2ndquadrant(dot)com>
2012-10-09 01:13:28 from Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
2012-10-06 14:16:37 from Jeremy Harris <jgh(at)wizmail(dot)org>
Lists:
pgsql-hackers
On Wednesday, October 03, 2012 04:28:59 PM Tom Lane wrote:
> Andres Freund <andres(at)2ndquadrant(dot)com> writes:
> > Maybe I am missing something here, but reindex concurrently should do
> > 1) BEGIN
> > 2) Lock table in share update exlusive
> > 3) lock old index
> > 3) create new index
> > 4) obtain session locks on table, old index, new index
> > 5) commit
> > 6) process till newindex->insisready (no new locks)
> > 7) process till newindex->indisvalid (no new locks)
> > 8) process till !oldindex->indisvalid (no new locks)
> > 9) process till !oldindex->indisready (no new locks)
> > 10) drop all session locks
> > 11) lock old index exlusively which should be "invisible" now
> > 12) drop old index
>
> You can't drop the session locks until you're done. Consider somebody
> else trying to do a DROP TABLE between steps 10 and 11, for instance.
Yea, the session lock on the table itself probably shouldn't be dropped. If
were holding only that one there shouldn't be any additional deadlock dangers
when dropping the index due to lock upgrades as were doing the normal dance
any DROP INDEX does. They seem pretty unlikely in a !valid !ready table
anyway.
Greetings,
Andres
--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services
In response to
Responses
pgsql-hackers by date
Next :From: Amit KapilaDate: 2012-10-03 15:15:16
Subject : Re: Switching timeline over streaming replication
Previous :From : Alvaro HerreraDate : 2012-10-03 14:38:57
Subject : Re: [9.1] 2 bugs with extensions