{"push_id":2696069465,"size":1,"distinct_size":1,"ref":"refs/heads/20180614-show-trace","head":"c626b0bc93c90d8fb1b3f15c8556df4b3b623800","before":"fb3c40f1f9679cae3616d6f0131c52622c64802f","commits":[{"sha":"c626b0bc93c90d8fb1b3f15c8556df4b3b623800","author":{"name":"Raphael 'kena' Poss","email":"ffa74aa72f5ed5e720c03212554d1e38d8a2905e@cockroachlabs.com"},"message":"sql: remove SHOW TRACE FOR <stmt>, enhance traces\n\nThree changes here:\n\n- removes `SHOW TRACE FOR <stmt>` (SHOW TRACE FOR SESSION remains)\n- new tracing option `results`\n- add missing tracing events, including schema changes and more\n  execution phases.\n\nThe implementation of `SHOW TRACE FOR <stmt>` was extremely complex\nbecause it needed to work properly when used as a sub-query: it needs\nto set up tracing for the duration of the sub-query but not further\nthan that. Also this implementation is woefully inadequate: because it\nwould only start tracing when the execution of the query would start,\nthe trace does not include any information about:\n\n- the work done during planning.\n- subquery execution.\n- query distribution.\n- lease acquisition.\n- transaction retries.\n- schema changes.\n- transaction cleanup.\n\nThe cost of maintaining the complexity added to the cost of running\ninto the pitfalls of incomplete traces is deemed to be too high and\nthis patch thus removes the feature.\n\nSHOW TRACE FOR SESSION remains and the following pattern can thus be\nused reliably instead:\n\n```\nSET tracing = on, <flags..>;\n<stmt>;\nSET tracing = off;\nSHOW TRACE FOR SESSION;\n```\n\nAn alternate approach trying to address the issues with the current\nimplementation, or move the logic to the connExecutor, failed.\n\nAn alternate patch was also considered, to remove the execution\nmechanisms and instead make `SHOW TRACE FOR <stmt>` simply syntactic\nsugar that expands to the 4 statements described above. This is not\ndone here however, because this implementation would introduce a new\nproblematic edge case: if the traced statement fails with a\nnon-retryable error, the session trace remains open and SHOW TRACE FOR\nSESSION is not run at all. This would be its own UX surprise.\n\nIn addition to these changes, this patch adds a few missing tracing\nevents, which enable further troubleshooting/analysis of traced\nqueries.\n\nFinally the tracing option `results` is added. This takes over part of\nthe tracing feature previously only implemented for option `kv`:\nprinting out the results produced by a query in the trace. This\nenables a client to get results in the trace without the overhead of\nKV tracing.\n\nRelease note (sql change): The `SHOW TRACE FOR <stmt>` statement was\nincomplete/incorrect and fixing it would introduce too much complexity\nand maintenance burden. This patch removes it. To use tracing, use\n`SET tracing = ...` and `SHOW SESSION TRACE` instead.\n\nRelease note (sql change): `SET tracing` accepts a new option\n`results`, which causes result rows and row counts to be copied to the\nsession trace. This was previously implicit with option `kv`, and must\nnow be specified explicitly when desired.","distinct":true,"url":"https://api.github.com/repos/knz/cockroach/commits/c626b0bc93c90d8fb1b3f15c8556df4b3b623800"}]}
{"actor":{"display_login":"knz"}}