{"action":"created","issue":{"url":"https://api.github.com/repos/prestodb/presto/issues/10867","repository_url":"https://api.github.com/repos/prestodb/presto","labels_url":"https://api.github.com/repos/prestodb/presto/issues/10867/labels{/name}","comments_url":"https://api.github.com/repos/prestodb/presto/issues/10867/comments","events_url":"https://api.github.com/repos/prestodb/presto/issues/10867/events","html_url":"https://github.com/prestodb/presto/issues/10867","id":333793884,"node_id":"MDU6SXNzdWUzMzM3OTM4ODQ=","number":10867,"title":"Add limit on maximum stages for a query","user":{"login":"electrum","id":9230,"node_id":"MDQ6VXNlcjkyMzA=","avatar_url":"https://avatars1.githubusercontent.com/u/9230?v=4","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},"labels":[{"id":136288195,"node_id":"MDU6TGFiZWwxMzYyODgxOTU=","url":"https://api.github.com/repos/prestodb/presto/labels/beginner-task","name":"beginner-task","color":"009800","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-06-19T18:47:05Z","updated_at":"2018-07-13T23:31:33Z","closed_at":null,"author_association":"MEMBER","body":"We should add a `query.max-stages` config property that is similar to `query.max-length` (max query text length) as a sanity check against queries that are unlikely to succeed (they will fail in weird ways or not render in the UI). These massive queries are usually generated as a list of `UNION ALL`, often as the result of users not being aware of `GROUPING SETS` (or `CUBE` / `ROLLUP`).\r\n\r\nI'm not sure what a good default would be. `100` seems safe, but might fail some legitimate queries that used to work.\r\n"},"comment":{"url":"https://api.github.com/repos/prestodb/presto/issues/comments/404978949","html_url":"https://github.com/prestodb/presto/issues/10867#issuecomment-404978949","issue_url":"https://api.github.com/repos/prestodb/presto/issues/10867","id":404978949,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDk3ODk0OQ==","user":{"login":"haozhun","id":2020503,"node_id":"MDQ6VXNlcjIwMjA1MDM=","avatar_url":"https://avatars3.githubusercontent.com/u/2020503?v=4","gravatar_id":"","url":"https://api.github.com/users/haozhun","html_url":"https://github.com/haozhun","followers_url":"https://api.github.com/users/haozhun/followers","following_url":"https://api.github.com/users/haozhun/following{/other_user}","gists_url":"https://api.github.com/users/haozhun/gists{/gist_id}","starred_url":"https://api.github.com/users/haozhun/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/haozhun/subscriptions","organizations_url":"https://api.github.com/users/haozhun/orgs","repos_url":"https://api.github.com/users/haozhun/repos","events_url":"https://api.github.com/users/haozhun/events{/privacy}","received_events_url":"https://api.github.com/users/haozhun/received_events","type":"User","site_admin":false},"created_at":"2018-07-13T23:31:33Z","updated_at":"2018-07-13T23:31:33Z","author_association":"CONTRIBUTOR","body":"Today, I saw a 1052-stage query.\r\n\r\nIn our cluster, \"max-requests-queued-per-destination\" is configured to 1000.\r\n\r\nPresto coordinator long polls Presto workers for tasks status changes. Therefore, I see no way that a 1000-stage query can finish without hitting `Max requests queued per destination 1000 exceeded for HttpDestination[http://host:port]@4e7537ed,queue=1000,pool=DuplexConnectionPool@2aed66ae[c=250/250,a=250,i=0]` (unless most tasks finish really quickly).\r\n\r\nWhen this happens, not only the query itself get killed, it also brings down other queries running at the same time.\r\n\r\nAs a result, I think this issue should be prioritized as a reliability fix."}}
{"actor":{"display_login":"haozhun"}}