{"action":"created","issue":{"url":"https://api.github.com/repos/greenplum-db/gpdb/issues/6185","repository_url":"https://api.github.com/repos/greenplum-db/gpdb","labels_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/6185/labels{/name}","comments_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/6185/comments","events_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/6185/events","html_url":"https://github.com/greenplum-db/gpdb/pull/6185","id":378658366,"node_id":"MDExOlB1bGxSZXF1ZXN0MjI5MzA4NTY0","number":6185,"title":"Ensure preassigned Oids aren't reused during upgrade","user":{"login":"danielgustafsson","id":321790,"node_id":"MDQ6VXNlcjMyMTc5MA==","avatar_url":"https://avatars2.githubusercontent.com/u/321790?v=4","gravatar_id":"","url":"https://api.github.com/users/danielgustafsson","html_url":"https://github.com/danielgustafsson","followers_url":"https://api.github.com/users/danielgustafsson/followers","following_url":"https://api.github.com/users/danielgustafsson/following{/other_user}","gists_url":"https://api.github.com/users/danielgustafsson/gists{/gist_id}","starred_url":"https://api.github.com/users/danielgustafsson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielgustafsson/subscriptions","organizations_url":"https://api.github.com/users/danielgustafsson/orgs","repos_url":"https://api.github.com/users/danielgustafsson/repos","events_url":"https://api.github.com/users/danielgustafsson/events{/privacy}","received_events_url":"https://api.github.com/users/danielgustafsson/received_events","type":"User","site_admin":false},"labels":[{"id":865288500,"node_id":"MDU6TGFiZWw4NjUyODg1MDA=","url":"https://api.github.com/repos/greenplum-db/gpdb/labels/Upgrade","name":"Upgrade","color":"a51e1c","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-11-08T10:01:58Z","updated_at":"2018-11-08T13:02:55Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/greenplum-db/gpdb/pulls/6185","html_url":"https://github.com/greenplum-db/gpdb/pull/6185","diff_url":"https://github.com/greenplum-db/gpdb/pull/6185.diff","patch_url":"https://github.com/greenplum-db/gpdb/pull/6185.patch"},"body":"During an upgrade, there are numerous new objects created in the new cluster which either doesn't have an Oids preallocated from the old, or which never existed in the old cluster to begin with. These objects are assigned Oids in the new cluster which may collide with Oids which are preassigned from the old cluster, but which hasn't yet been used in the restore process. This is because the restore process is doing the preallocation just before the object creation.\r\n\r\nTo avoid collisions, the Oids which will be preassigned are tracked during schema dump, and are injected into the Oid dispatch machinery before any object is restored such that the list can be queried. This requires a new mode of dumping in pg_dump where an object is recorded first in the dependency chain but is dumped last. To support this, a new API for amending ArchiveEntry objects has been added. Currently it only supports changing the definition but it can easily be extended to cover future usecases.\r\n\r\nThe performance of this patch is a TODO, passing all the Oids in an array in a single call is unlikely to scale to real-world scenarios but it's better to subject this to a wider audience sooner rather than later.\r\n\r\n@jchampio What do you think about this approach? It's halfway going back to when we did blanket preallocations of everything, but in a bit more lightweight fashion. "},"comment":{"url":"https://api.github.com/repos/greenplum-db/gpdb/issues/comments/436986448","html_url":"https://github.com/greenplum-db/gpdb/pull/6185#issuecomment-436986448","issue_url":"https://api.github.com/repos/greenplum-db/gpdb/issues/6185","id":436986448,"node_id":"MDEyOklzc3VlQ29tbWVudDQzNjk4NjQ0OA==","user":{"login":"hlinnaka","id":191602,"node_id":"MDQ6VXNlcjE5MTYwMg==","avatar_url":"https://avatars2.githubusercontent.com/u/191602?v=4","gravatar_id":"","url":"https://api.github.com/users/hlinnaka","html_url":"https://github.com/hlinnaka","followers_url":"https://api.github.com/users/hlinnaka/followers","following_url":"https://api.github.com/users/hlinnaka/following{/other_user}","gists_url":"https://api.github.com/users/hlinnaka/gists{/gist_id}","starred_url":"https://api.github.com/users/hlinnaka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hlinnaka/subscriptions","organizations_url":"https://api.github.com/users/hlinnaka/orgs","repos_url":"https://api.github.com/users/hlinnaka/repos","events_url":"https://api.github.com/users/hlinnaka/events{/privacy}","received_events_url":"https://api.github.com/users/hlinnaka/received_events","type":"User","site_admin":false},"created_at":"2018-11-08T13:02:55Z","updated_at":"2018-11-08T13:02:55Z","author_association":"MEMBER","body":"> > Does PostgreSQL have the same issue?\r\n> \r\n> I don't see why it wouldn't risk Oid collisions, but I have also not seen any reports of it happening. That doesn't mean it never happens (and it might be that error masquerades as something else) of course, but it may simply be that it's an ever more rare cornercase than in Greenplum.\r\n\r\nWould be good to try to reproduce this with PostgreSQL. If it happens there as well, then we should develop a fix on pgsql-hackers. If it doesn't, then we should understand what we're doing differently in GPDB that makes it susceptible."}}
{"actor":{"display_login":"hlinnaka"}}