Обсуждение: BUG #14236: pg_upgrade failed

Поиск
Список
Период
Сортировка

BUG #14236: pg_upgrade failed

От
nqtien310@gmail.com
Дата:
VGhlIGZvbGxvd2luZyBidWcgaGFzIGJlZW4gbG9nZ2VkIG9uIHRoZSB3ZWJz
aXRlOgoKQnVnIHJlZmVyZW5jZTogICAgICAxNDIzNgpMb2dnZWQgYnk6ICAg
ICAgICAgIFRpZW4gTmd1eWVuCkVtYWlsIGFkZHJlc3M6ICAgICAgbnF0aWVu
MzEwQGdtYWlsLmNvbQpQb3N0Z3JlU1FMIHZlcnNpb246IDkuNC4xCk9wZXJh
dGluZyBzeXN0ZW06ICAgTGludXgKRGVzY3JpcHRpb246ICAgICAgICAKClRv
IHdob20gdGhpcyBtaWdodCBjb25jZXJuLA0KDQpJIHVwZ3JhZGVkIFBvc3Rn
cmVzIGZyb20gOC40IC0+IDkuNCBhIGNvdXBsZSBvZiBkYXlzIGFnbyB1c2lu
ZyBwZ191cGdyYWRlCndpdGggLWsgKCBoYXJkIGxpbmsgKSBvcHRpb24NCiAg
LSAvdXNyL3Bnc3FsLTkuNC9iaW4vcGdfdXBncmFkZSAtayAtZCAvdmFyL2xp
Yi9wZ3NxbC9kYXRhIC1ECi92YXIvbGliL3Bnc3FsLzkuNC9kYXRhIC1iIC91
c3IvYmluLyAtQiAvdXNyL3Bnc3FsLTkuNC9iaW4vDQoNCkl0IHdvcmtlZCBm
aW5lIHVudGlsIHllc3RlcmRheSwgdGhlIG5ldyBkYXRhYmFzZSBzZWVtIHRv
IGJlIGNvcnJ1cHRlZCwgaXQKcmV0dXJucyBhIHZlcnkgd2VpcmQgZXJyb3Ig
KEkgZm9yZ290IHRvIGNhcHR1cmUgdGhvc2UgZXJyb3JzKS4gVGhlcmVmb3Ig
SQpoYXZlIHRvIGRlbGV0ZSB0aGUgbmV3IGNsdXN0ZXIgDQogIC0gcm0gLXJm
IC92YXIvbGliL3Bnc3FsLzkuNC9kYXRhDQoNCkFuZCBydW4gdGhlIHVwZ3Jh
ZGUgYWdhaW4sIHRoaXMgdGltZSBJIGdldCB0aGUgZm9sbG93aW5nIGVycm9y
DQogIC0gcGdfZHVtcDogcXVlcnkgdG8gZ2V0IGRhdGEgb2Ygc2VxdWVuY2UK
ImFzc2V0X3RyYWNrZXJfbm90aWZpY2F0aW9uc19pZF9zZXEiIHJldHVybmVk
IDAgcm93cyAoZXhwZWN0ZWQgMSkNCg0KVGhlcmUncyBhIGNvdXBsZSBvZiB0
aGluZ3MgdGhhdCBhcmUgY29uZnVzaW5nIG1lDQogLSBXaHkgSSBjYW4ndCBy
dW4gdGhlIHVwZ3JhZGUgbm93LCBpcyB0aGVyZSBhbnkgY2hhbmdlIHRoaXMg
Y2FuIGJlIGZpeGVkCj8NCiAtIFdoYXQgY2F1c2UgdGhlIG5ldyBkYXRhYmFz
ZSB0byBiZSBjb3JydXB0ZWQsIGlzIGl0IHJlbGF0ZWQgdG8gdGhlIC1rICgK
aGFyZCBsaW5rICkgb3B0aW9uID8NCiAtIFdoYXQgaXMgdGhlIGNvcnJlY3Qg
d2F5IHRvIHVzZSB0aGUgLWsgKCBoYXJkIGxpbmsgKSBvcHRpb25zID8NCg0K
QW55IGhlbHAgd2lsbCBiZSBoaWdobHkgYXBwcmVjaWF0ZWQsIHdlJ3JlIGdv
bm5hIGRvIHRoZSByZWFsIHVwZ3JhZGUgb24KUHJvZHVjdGlvbiBuZXh0IHdl
ZWsgLCBzbyB0aGlzIGlzIHZlcnkgdXJnZW50LCB0aGFua3MgaW4gYWR2YW5j
ZWQgCgo=

Re: BUG #14236: pg_upgrade failed

От
Bruce Momjian
Дата:
On Fri, Jul  8, 2016 at 04:28:48AM +0000, nqtien310@gmail.com wrote:
> The following bug has been logged on the website:
>
> Bug reference:      14236
> Logged by:          Tien Nguyen
> Email address:      nqtien310@gmail.com
> PostgreSQL version: 9.4.1
> Operating system:   Linux
> Description:
>
> To whom this might concern,
>
> I upgraded Postgres from 8.4 -> 9.4 a couple of days ago using pg_upgrade
> with -k ( hard link ) option
>   - /usr/pgsql-9.4/bin/pg_upgrade -k -d /var/lib/pgsql/data -D
> /var/lib/pgsql/9.4/data -b /usr/bin/ -B /usr/pgsql-9.4/bin/
>
> It worked fine until yesterday, the new database seem to be corrupted, it
> returns a very weird error (I forgot to capture those errors). Therefor I
> have to delete the new cluster
>   - rm -rf /var/lib/pgsql/9.4/data
>
> And run the upgrade again, this time I get the following error
>   - pg_dump: query to get data of sequence
> "asset_tracker_notifications_id_seq" returned 0 rows (expected 1)
>
> There's a couple of things that are confusing me
>  - Why I can't run the upgrade now, is there any change this can be fixed
> ?
>  - What cause the new database to be corrupted, is it related to the -k (
> hard link ) option ?
>  - What is the correct way to use the -k ( hard link ) options ?
>
> Any help will be highly appreciated, we're gonna do the real upgrade on
> Production next week , so this is very urgent, thanks in advanced

The documentation says:

     If you use link mode, the upgrade will be much faster (no file
     copying) and use less disk space, but you will not be able to access
     your old cluster once you start the new cluster after the upgrade.

"You can't access" also means can't re-upgrade the cluster.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

+ As you are, so once was I. As I am, so you will be. +
+                     Ancient Roman grave inscription +

Re: BUG #14236: pg_upgrade failed

От
Michael Paquier
Дата:
On Fri, Jul 29, 2016 at 11:49 AM, Bruce Momjian <bruce@momjian.us> wrote:
>> Any help will be highly appreciated, we're gonna do the real upgrade on
>> Production next week , so this is very urgent, thanks in advanced
>
> The documentation says:
>
>      If you use link mode, the upgrade will be much faster (no file
>      copying) and use less disk space, but you will not be able to access
>      your old cluster once you start the new cluster after the upgrade.
>
> "You can't access" also means can't re-upgrade the cluster.

Which is why you need to be careful and take a backup of the old
cluster's PGDATA when you use --link. Then in case of upgrade failures
you can fallback to that easily. Using --link has the advantage of
speed, and it has also the advantage to minimize the error handling
when a disk gets full if that's a constraint in what you do, because
you don't need to have up to twice the amount of space required to
hold on a system the old and new cluster's data (tablespaces on the
new and old instances share the same base path, with a different
sub-folder).
--
Michael