{"action":"created","issue":{"url":"https://api.github.com/repos/prestodb/presto/issues/6601","repository_url":"https://api.github.com/repos/prestodb/presto","labels_url":"https://api.github.com/repos/prestodb/presto/issues/6601/labels{/name}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/6601/comments","events_url":"https://api.github.com/repos/prestodb/presto/issues/6601/events","html_url":"https://github.com/prestodb/presto/issues/6601","id":188626528,"number":6601,"title":"Concurrent ADD COLUMN operation in Raptor","user":{"login":"buremba","id":82745,"avatar_url":"https://avatars.githubusercontent.com/u/82745?v=3","gravatar_id":"","url":"https://api.github.com/users/buremba","html_url":"https://github.com/buremba","followers_url":"https://api.github.com/users/buremba/followers","following_url":"https://api.github.com/users/buremba/following{/other_user}","gists_url":"https://api.github.com/users/buremba/gists{/gist_id}","starred_url":"https://api.github.com/users/buremba/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buremba/subscriptions","organizations_url":"https://api.github.com/users/buremba/orgs","repos_url":"https://api.github.com/users/buremba/repos","events_url":"https://api.github.com/users/buremba/events{/privacy}","received_events_url":"https://api.github.com/users/buremba/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-11-10T21:44:20Z","updated_at":"2016-11-11T04:46:56Z","closed_at":null,"body":"When we perform `ALTER TABLE ADD COLUMN` operation in a Raptor table concurrently, it may fail because Raptor doesn't use any lock for `columnId` when inserting metadata of new column:\r\nhttps://github.com/prestodb/presto/blob/master/presto-raptor/src/main/java/com/facebook/presto/raptor/RaptorMetadata.java#L446\r\n\r\n`addColumn` method is not synchronized, in a concurrent environment `columnId` may exist when `dao.insertColumn` method is called. Given that there may be multiple coordinators, I think we may just use optimistic locking and try to insert column in a loop."},"comment":{"url":"https://api.github.com/repos/prestodb/presto/issues/comments/259880431","html_url":"https://github.com/prestodb/presto/issues/6601#issuecomment-259880431","issue_url":"https://api.github.com/repos/prestodb/presto/issues/6601","id":259880431,"user":{"login":"electrum","id":9230,"avatar_url":"https://avatars.githubusercontent.com/u/9230?v=3","gravatar_id":"","url":"https://api.github.com/users/electrum","html_url":"https://github.com/electrum","followers_url":"https://api.github.com/users/electrum/followers","following_url":"https://api.github.com/users/electrum/following{/other_user}","gists_url":"https://api.github.com/users/electrum/gists{/gist_id}","starred_url":"https://api.github.com/users/electrum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/electrum/subscriptions","organizations_url":"https://api.github.com/users/electrum/orgs","repos_url":"https://api.github.com/users/electrum/repos","events_url":"https://api.github.com/users/electrum/events{/privacy}","received_events_url":"https://api.github.com/users/electrum/received_events","type":"User","site_admin":false},"created_at":"2016-11-11T04:46:56Z","updated_at":"2016-11-11T04:46:56Z","body":"We could do \"select ... for update\" on the row in the \"tables\" table as a table lock.\n"}}
{"actor":{"display_login":"electrum"}}