Skip to content

Commit

Permalink
jobsprofiler: annotate backup DSP diagram with per-proc progress
Browse files Browse the repository at this point in the history
This change teaches `SHOW JOB <jobID> WITH EXECUTION DETAILS`
when run against a backup job to annotate the latest DSP diagram
stored for the backup with per-node, per-processor progress
information. This annotated diagram is then re-serialized and
stored as the most up-to-date DSP diagram for that job.

The backup job is the first of its kind to annotate a DSP diagram
with per-node, per-proc progress information and so this change
adds some logic to deserialize a flow diagram from a URL and
annotate the diagram's processors with progress information.

Informs: #100488

Release note (sql change): `SHOW JOB WITH EXECUTION DETAILS` for
a backup job will regenerate the DistSQL plan diagram with per-node,
per-processor progress information. This will help better understand
the state of a running backup job.
  • Loading branch information
adityamaru committed Jun 15, 2023
1 parent c1a71cf commit 88f311d
Show file tree
Hide file tree
Showing 44 changed files with 969 additions and 376 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ vectorized: true
table: orders@orders_pkey
spans: [/'ap-southeast-2'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727' - /'ap-southeast-2'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727'] [/'us-east-1'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727' - /'us-east-1'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727']
·
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk9tO20wQx--_pxjNDQdtlPgACZaQjPhSGpQGmlC1UjeKjHcCW5Jdd3etpkK56rP1vSp7SUNQgwTthb2n-e_M72_PPdqvM0yw--myf9IbwO7_vdHV6H1_D0bdfvf0CrQRZCZSMCiMnuuHmcwJTkZ-Mvkm3a0u3aQOWJ3ug5A216Vym4E-Ct4ML975uy2cX_QG_nYLH0a9wRnsrnLtwce33WH3dxVwDDtHMcXXnbjd6EzDaSPO8oNGJ5oGjcM4EIcUiWk7bO8gQ6UFDbI5WUw-Y4xjhoXROVmrTbV1Xwf0xAKTFkOpitJV22OGuTaEyT066WaECV5l1zMaUibINFvIUJDL5Ky-1hOkfpgUd_QdGZ7qWTlXNtnwTua0thAZjoqsCmlyTDk2OXK-OIo5X1D1uu6ccb7oTJvnP39wvpgGgvNFINRxtWjvcGy2IFMCAtDulgyOlwx16dYI1mU3hEmwZK_DDP49ZgXUehXqVrxwK96aypKR2QxKVVdJYgNsvPyDDwPd0EUz3HSgL-fSQbC1lNZLnD7XUj0YHW2m8V2Q-mFldF_ru7KAL1oq0CqBNHrs_rotVw2HDIekBJkE0oBBGjFIw-rZTw-2AkQvARiSLbSy9MTMbdaMGZK4If9hrC5NTpdG53Uav7yodfWGIOv8aegXPVUf1f_yY3HwN-LwWXG0IW49FUfPiuMn4vHyv18BAAD__47ayRw=
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk2tP2zwUx98_n8I6b7goVXODlkhIQdCHFZXC2k6bNFdViE_AI7Uz2xFFqK_22fa9JieUXkTRQIvU-Hb69_n9T84T6J85RND5dt076fbJ7ll3OBp-7u2RYafXOR0RqRiqCWcOKZScyucZT5GcDOvJ5IGbO1maSRWwON0njOtUlsKsB9ZR5P_B1WWtrcnFVbdfq2vyZdjtn5PdxV175OunzqDzkgU5JjtHIYY37bDVaGd-1giT9KDRDjKvcRh67BADlrX81g44ICTDfjJFDdF3CGHsQKFkilpLZbeeqoAum0HkOsBFURq7PXYglQohegLDTY4QwSi5yXGACUPVdMEBhibheSVbE8T1MCnu8REcOJV5ORU6WvOOp7i0EBwYFokNaVKIKTQpUDo7CimdoX3dtM8pnbWz5sXvX5TOMo9ROvOYOLaL1g6FpksSwYhHpLlDBeO5A7I0SwRtkluEyFth7p5B5M6dj2F7_x7bArofQt-K62_geltxl5QaFU9yUooqa2RroOP5K770ZUMWTX_dkR6fckO8ram5G6n576nEheTiuRDB-rV118T1sChET8r7siA_JBdEiojEwWp1lm28aFBwYICCoYpI7DkkDhwS-_a3Hx9sBQo2gIL3AA1QF1Jo3DD776xreLYqyG6xrqSWpUrxWsm0iq2XV5VQtcFQm_rUrxddUR159gaFyfTlU1lV8j6q5G4q-W8qBWtK7qqSv6kUvKkUbldyrWNZLh9sE0bgPj-NV16LB-wfklttyza8kw-V7OixsKZnSa7RgcvkHs_QoJpywbXhKURGlTif__cnAAD__8jUE1E=

skipif config multiregion-9node-3region-3azs-no-los
query T nodeidx=3
Expand Down Expand Up @@ -410,7 +410,7 @@ vectorized: true
table: orders@orders_pkey
spans: [/'ap-southeast-2'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727' - /'ap-southeast-2'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727'] [/'us-east-1'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727' - /'us-east-1'/'94e4b847-8f2f-4ac5-83f1-641d6e3df727']
·
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyslN1u2koQx-_PU6zmJudES_AnEEuRNsqhLRGFFCK1Uhchxzsk28Cuu163riKu-mx9r8o2-SCqqUh7Aeudmb9nfrOzvoPs8xIi6H-4GJ4ORuTf_wfTy-m74X9k2h_2zy6JNgLNXApKUqNXOjuqlo1BJkhOp_XD_Ku0Nzq38yrg3ntIhMwSnSu7HVhHkVeT8ds6RUbOx4PRJgkZ3z8dSbXQhPHccXzcRNa292_6k_5DeeSEHBwHGFz1gm6rt_AWrSBOwlbPX7itTuCKDvpi0fW6B0BBaYGjeIUZRB8hgBmF1OgEs0yb0nRXBQxEAZFDQao0t6V5RiHRBiG6AyvtEiGCy_hqiROMBZq2AxQE2lguq9fWlbJ6mae3-A0onOllvlJZtNVUmSAlJRFQmKZx6W5zYBzaHDgvjgPOCyz_rnqvOS96i_b5j--cFwtXcF64Qp2Um-4Bh7ZDYiWIS7S9QQOzNQWd28fyMxtfI0Tumr4M0f27iCWM8yLMRjSvEe2RKEMj4yXJVVUhii2o2foXPRjplk7b3jb9UK6kJW5jKc4-XR6oL2gsinMtFZq2v52qvgmsXuZlH-dSFEAfZP0iNYSFD9eE-U9P4vHCbo5gnNuIMJcyjzKfsqCRwd-Hoax9MyjBrvo3gzLU-jZPySctFdEqIqwUj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7laKuUnxU6bRfyXO3WGzU3VpwSMDbP4OvvB4ecAuya-NSaXWj7hrZiy-lS4Qi2xik8Cm7xTO0qLdCCmNFDonVFe523_0bAAD__51rvcs=

# Regression test for #74890. Code should not panic due to distribution already
# provided by input.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM regional_by_row_table WHERE pk =
table: regional_by_row_table@regional_by_row_table_pkey
spans: [/'ap-southeast-2'/1 - /'ap-southeast-2'/1] [/'ca-central-1'/1 - /'ca-central-1'/1] [/'us-east-1'/1 - /'us-east-1'/1]
·
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8kF-r00AQxd_9FMM8qazkT32QgHDlmmKgttckoHATwjY7lJjc7Lq7wZaS7y5JHmoliLbcPs6ZOTPnN0c0PxoMMAlX4X0Kr2EZbz7DY_jtYfUhWsPLj1GSJl9Wr-B8QNOuki1viu2h0PJnYfm2Ifj6KYxDUDW8By-HzXKZhCn4yLCVgtb8iQwGj-hhzlBpWZIxUg_ScRyIxB4Dl2HVqs4Ocs6wlJowOKKtbEMYYDrciYkL0o6LDAVZXjXj2tlId7NqoWo6IMN72XRPrQlA1QxU7TPgDLYMviPDRPGh42R4l6HjOS7mPUPZ2VM4Y_mOMPB6dhmAdyOALNu_c58Lwr8dRHk5xCl710otSJM4y533M5hr-UYqZ_HH4Pxp_3_-F5NRsjX0T5vdIRqJHU0cRna6pActy_HMVG5G3ygIMnbqLqYiasfW-Jvfzd41Zv8a8-Kv5rdnZrfP-xe_AgAA__9014gb
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8klGrmzAUx9_3KcJ52kaKxu5hBAZ33Fom9LZ3VdjgViTVczunNVkS6S3F7z602-6tuLH2oXkQcnL8nf8vegDzowQOoT_zbyPylkyXizvy4H-9n30M5uT1JAij8PPsDTlt0LjJZSXKZL1PtNwlVqxLJF8--UufqIJ8ICwmi-k09CPiAYVKZjgXWzTAH4BBTEFpmaIxUrelQ9cQZE_AXQp5pWrblmMKqdQI_AA2tyUCh6ids0SRoXZcoJChFXnZYQcj3QxWE1XgHijcyrLeVoYTVVCiCo8SQcmaku9AIVSiPXFWcLMChzkuxA0FWdvncMaKDQJnL2yCCXC3oZcJsSsJrVZP790zpdilUt71pNJzpby_Sj271JXUGWrMTjziZkB7LkdSOeNe43AUrxdlfM79LtEoWRn8r0lub9KItdkx2-BR1Mhap3ivZdr1HreLDtQVMjT2eDo-boKqO2LtBI1i--eff0lil5JYn-RdSvL6pPE_Se9OSO6pXUzhsZS7JM-Ag_trjQYevxe0L4iNaT9b-E3uOmy0V-2lP4rSIIU7UeAELeptXuXG5ilwq2tsmlc_AwAA__9wGtJB

statement ok
SET vectorize=on
Expand Down Expand Up @@ -483,7 +483,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM regional_by_row_table WHERE pk =
table: regional_by_row_table@regional_by_row_table_pkey
spans: [/'ca-central-1'/1 - /'ca-central-1'/1] [/'us-east-1'/1 - /'us-east-1'/1]
·
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8kl-L00AUxd_9FJf7pDKSP60gAWFlTbFQ27UJKGxCmGYuJSbNjDMT3KXku0uShzUSu7td6OP988s952SOaH5VGGAUrsLrGN7CYrv5Crfhj5vVp-UaXn9eRnH0bfUGxgua9oWseZXt7jMtf2eW7yqC71_CbQiqhI_gpbBZLKIwBh8Z1lLQmh_IYHCLHqYMlZY5GSN11zr2C0txh4HLsKhVY7t2yjCXmjA4oi1sRRhg3N3ZEhekHRcZCrK8qPrPTkq6muxmqqR7ZHgtq-ZQmwBUyUCVPgPOYMfgJzKMFO8mToJJcvfBTdDxHBfTlqFs7INAY_meMPBadp4J73Im8vNNPGhvaqkFaRIj3Wk7YXMt30nl-P8sTp_2z81vdqH8rh7JbvaE7Azpglfw7AjnY4-r4lBY8P4rxX1OllsyStaGnvSX3E4jiT0NvoxsdE43Wub9maHc9FzfEGTsMPWHYln3o_6d_Q17L4H9k_D8NDx7CTw_Cb8fwW6btq_-BAAA___NQ8qq
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8k1Fr2zAUhd_3K8R92oZCLCeDIRh0NA4LpEkXBzZoTFDs20yLY2mSTBqC__uws621cbomD9WDQVfX3z3nyD6A_ZUChzAYB9dz8p4MZ9Mbchd8vx1_Hk3I28EonIdfx-9IvcHgWqpMpMvVfmnUbunEKkXy7UswC4jekE-ERWQ6HIbBnPhAIVMJTsQWLfA7YBBR0EbFaK0yZelQNYySB-AeBZnp3JXliEKsDAI_gJMuReAwL-fMUCRouh5QSNAJmVbYVklXrdWl3uAeKFyrNN9mlhO9oURvfEoEJStKfgKFUIvypLuAxeLho7eALut6EBUUVO4eBVon1gicPXE0GgD3CnqZKfZ6puJzTbGTph695JkyCRpMaj6iosX2RHWU7vqNxnYpfkOKf2m-vVfK9-o_2fYahnovyNaikSIlZ0fcr3sey610hJ2U5jWk9c_JeoZWq8zii261OanDShOYrPFo3KrcxHhrVFz1HrfTClQVErTueOofN6OsOmLlBINi--9XfEpil5JYk-Q_S-qfJvWapN6lJL9J6j9L-lAjefWcIgr3qdotZQIcvD-r0_L4u6B8Qaxt-QGEP9Suws73ury-e5FapHAjNjhAh2YrM2mdjIE7k2NRvPkdAAD__67tHiA=

query T
EXPLAIN (VEC) SELECT * FROM regional_by_row_table WHERE pk = 1
Expand All @@ -504,7 +504,7 @@ SET vectorize=off
query T retry
SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM regional_by_row_table WHERE pk = 1] AS temp(a) WHERE a LIKE '%Diagram%'
----
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8keFr1EAQxb_7VwwDpa2sJBu_SEBoaSMG47VeDhR64di7Hc71kt11d4MtR_53uUQ4IxdBBT_Oe_Mm75fdo_9aY4plVmQ3C3gOb-Z37-Eh-3RfXOczuLjNy0X5obiE8YKjrTJa1Kv108qZb6sg1jXBx7fZPAO7g9fAK7guIVBj4UJc_nAEFPm7DM7PbpXYOtGcnSNDbSTNREMe0wfkWDG0zmzIe-MO0r5fyOUjpjFDpW0bDnLFcGMcYbrHoEJNmOLi0GFOQpKLYmQoKQhV92dP1r06qa7sjp6Q4Y2p20b7FOyOgd0lDASDNYMvyLC04uBES1wuH1_FS4x4FIPQEjiY8JkcVh1D04ZjWR_EljDlHfs7IP6fgK4GmEmAZBLg2NuTU6KGVhsnyZEcVa-6E6Qz88LYKBkzFqpRAfhklfhP_uWcvDXa0y9dpi5XDEluaeDypnUbundm039mGO_6XC9I8mFwk2HIdW_1j_1zmP9LOPlt-OUoHHdV9-x7AAAA__-eCkLr
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJy8kFFr2zAQx9_3KY6D0nYoxPJehmDQ0njMLE27OLBBY4ISXVMttqVJMmkI-e7DTrc2IRlbH6YHg-7OP_1_t0b_o0CBWdJPrkbwFj4Ob67hLvl2279MB3DWS7NR9qV_DrsDjubaVLKYTFcTZ5aTIKcFwddPyTABu4APwHO4zCBQaeFMnj91JPTTzwmcnvS0nDtZnpwiw8ooGsiSPIo75JgztM7MyHvjmtK6HUjVI4qIoa5sHZpyznBmHKFYY9ChIBQ4ajIMSSpy3QgZKgpSFy32YNyLg9WJXdAKGV6Zoi4rL8AuGNhFzEAymDL4jgwzK5tOd4zj8eP7aIxd3o1AVgo4mPBADvMNQ1OH57A-yDmh4C_s0h6KaMNeJ8j_k-DFVu6oULwnxI8KPXt4cloWUFfGKXKkdlTyzQHzgekY2413nfu61AH40WjRXrT4X3Y9JG9N5Wkv29-91OGNBKk5bcW9qd2Mbp2ZtbPb600LaguKfNh24-0lrdoWb15wJMvfm31J4q8lRfuk-I-kdzukaJeUM7wvzHKiFQqMnk7nwOfXweYHOffNsrMHs2yxo5VtVnUvC08Mr-WCehTIlbrSPugZiuBq2mze_AwAAP__m_KD0g==

statement ok
RESET vectorize
Expand Down Expand Up @@ -815,7 +815,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child WHERE NOT EXISTS (SELECT *
table: child@child_pkey
spans: [/'ca-central-1'/10 - /'ca-central-1'/10] [/'us-east-1'/10 - /'us-east-1'/10]
·
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk9Fro0AQxt_vrxjmJcmxR1bjQVkoWFrDWTzTS4QrNBKsO7Re7a63KqSU_O-HmqMxXALt5UXd2fnc3zd8-4rl7xwFLrzAu4zgM0zns-9w593eBBd-CMMrfxEtfgQj6Dekj1ku4ec3b-7BMJxF4N02jTDstxWJIVVt-4pVJuEc0lXzMRrBRXgFw7QrWnwUw2w6XXgR2MhQaUlh8kwliju0MGZYGJ1SWWrTlF7bBl-uUXCGmSrqqinHDFNtCMUrVlmVEwqMkvuc5pRIMmOODCVVSZa3v209uO1zVTzRCzK81Hn9rEoBDRbboiLDRZE01fESl8v1GV_i2OJjDomSYIGuHslgvGGo6-qNpKySB0JhbdjHaK0T0Lpb0oN09kG6N6iSTJbkUCttJBmSPa548w8bof6ii7HdNxBkz1kF1kEU_p5BXetMbec06R8TvRQkIPCmEVyEkQ_XMz9Ehl0S3e71d4CB1k91Ab90pkArAUPXgXNYDxw-EEK4FucWP9sG1bXhHNzJaHfuRTd3I-9Xhh4yrQ6am3zQnHNac82NXg_Odu0xWA_Snt-TGHbeY3hOZaFVSXvJOpSTmCHJB-pSWurapHRjdNoe0y1nra4tSCqrbtfuFr5qt9p7uSu2_kdsHxVPemK-L54cFTvHxc5R8dc9cbz59CcAAP__ibHiWg==
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJyslNFr6kgUxt_3rzicF3VJcRJdKAOFlBrZFBu7GthCFUmTUzu3MZM7k1BL8X-_TGJvTajltjQP0Zwcf_N9Zz7nBfXPFDnOvYl3EcLfMJ5Nr-DWu7menPsBdEf-PJz_N-lBsyF-EGkC___rzTzoBtMQvBvTCN1mWx4pyop9X74SCZxBvDJfej04D0bQjeuizXpLmI7Hcy8EBy3MZEJBtCGN_BZtXFqYKxmT1lKZ0kvV4Cdb5MxCkeVlYcpLC2OpCPkLFqJICTmG0V1KM4oSUn2GFiZURCKtsJUHt7qv8kd6RgsvZFpuMs3ByLL2UtHCeR6Zan-Bi8X2lC2wb7M-gyhLwAZZPJDC5c5CWRZvSnQRrQm5fSDdHyFnO-tr6u1vUO_ulR9V67TU2kfVvonUpESUQplJlZCipKFzuXvHViBPZN53moYmYiMKsI9KYy1pzmcGeSlFtp_joLls-JwTh4k3DuE8CH24nPoBWlgn160_Xgc8kfKxzOGHFBnIjEPXHcIZbDtD1uGcuzZjNjvdB9t14AzcQe9wX_J6X1Ryt1K0FjI7anbQMjv4otnh95o1J8K2c3po14JtJ274_5YBDFsDGH5mADPSucw0tZL4Z7k6sU1kKVlTHXMtSxXTtZJx1Vs_TitQVUhIF_Vbp37ws-qVbVZQFG1-_48OSfZXSaxNcj4kDRokdkhy2qTBh6ThcdKgTRp-SPrnOImZ2d-n8smcXBzZ_jp55_Z6oflBtNYmAPMH-VRhTdA18vso1WThVfRIIypIbUQmdCFi5IUqabf761cAAAD__yS4NdA=

statement ok
SET vectorize=on
Expand Down Expand Up @@ -892,7 +892,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child WHERE EXISTS (SELECT * FROM
table: child@child_pkey
spans: [/'ca-central-1'/10 - /'ca-central-1'/10] [/'us-east-1'/10 - /'us-east-1'/10]
·
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk9Fro04Qx99_f8UwL0l-7JHV5CEsBCyt4Sw26UXhCo0E6w6pV7PrrQopIf_7oeauNdcUencv6s7Od_az3xn3WHzPUGDg-u5lCP_DbLm4gXv37ta_8ObQv_KCMPjiD6CbkDymmYSvn92lC-5dnQP9bkYeG1LlMSVfpxKmkKzrjwFczK-gn7Qxiw8iWMxmgRuCjQyVljSPt1SguEcLI4a50QkVhTZ1aN8keHKHgjNMVV6VdThimGhDKPZYpmVGKDCMHzJaUizJDDkylFTGadaUbeid5rnOn-gZGV7qrNqqQkCNxY6kyDDI4zo6XOFqtZvwFQ4tPuQQKwkW6PKRDEYHhroqX0iKMt4QCuvA_ozW-ge0zpH0LJ19lu4FqiCTxhlUShtJhmSHKzq8cY25_qTzod29gJ9u0xKssyj8I0Zd61QdfRp1jwmfcxLgu7MQAvfGg-uFN0eG7SA67eungb7WT1UO33SqQCsBfWcMU9j1xrwnhHAszi0-OQ6qY8MUnNEAGS5pq0uC7A11_bPsepPXega7XtIp-HvFX53M204a-bA2tEm1OmvX6CN2LanItSropHXnGhExJLmhdgwKXZmEbo1OmmPa5aLRNQFJRdnu2u3CU81WM_ivxdbfiO13xaOOmJ-KR--Kxyfi6PDfjwAAAP__S-6YJw==
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk0Fv4jwQhu_frxjNBfjkCif0UFmqRFWClopClyBtpYJQmkyptyHO2o5KVfHfV05oS9hSbavNweDx-PXjd8bPaH6lKDAMhsH5FP6H_mR8CTfB9dXwbDCCZm8QTsPvwxbUE-J7mSbw41swCSC4djnQrGfkkabMblPyhUzgFOKF-9OCs1EPmnEV83hrDuN-Pwym4CPDTCU0ilZkUNygh3OGuVYxGaO0Cz2XCYNkjYIzlFleWBeeM4yVJhTPaKVNCQVOo9uUJhQlpNscGSZkI5mWsiV9txwX-QM9IcNzlRarzAhwWGxLigzDPHLR9gxns_UJn2Hb420OUZaAB8rek8b5hqEq7BuJsdGSUHg76IMeCr5hX6P3_gF9d0t-kNbfo_UO0r5BGtIySqHIlE5IU1LjnG_eudZIHam87dcvNJQracE7iMb30PzPGHmhZLb1sVM_dvqUk4Bh0J9CGFwO4GI8GCHDqnG71c-LwUOlHoocfiqZgcoENLvHcArrxjFvCCG6HuceP9k2dteHU-h2WshwQitlCdJ3drvHtW6c7O5nsG7ENcE_FV8rnVeV1sntQtNSquygfZ09-zqfsW9CJleZob3S_l2hjjzXA5Qsqeobowod05VWcZlbTcelUBlIyNhq1a8mg6xc8twJmqLVa2PuKnlfVeL7Sv6HSp2aEt9V8veVOh8qHR9W4s6xu1Q9ugcskG-_o3eGlw_dhmhpXNnCe_VYyrrmNijuotQQw8vogXpkSa9kJo2VMQqrC9ps_vsdAAD__6Zd4k0=

statement ok
SET vectorize=on
Expand Down Expand Up @@ -970,7 +970,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child INNER JOIN parent ON p_id =
table: child@child_pkey
spans: [/'ca-central-1'/10 - /'ca-central-1'/10] [/'us-east-1'/10 - /'us-east-1'/10]
·
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk1Fr2zAQgN_3K457STs0Itt9CIKAS-swl8zunMAGjQmudaReHcmTZcgI-e8jdrbWWVPothfbOuk7fbqTt1h_L1HgLJgGV3N4D5Mk_gR3wdfb6WUYwdl1OJvPPk_Pob8gfyhKCWEUBQncxGEEVWZIWYgjqJaFhDHky_bjy8cgCSDvYg5PIZ5MZsEcXGSotKQoW1ON4g4dTBlWRudU19rsQ9t2QSg3KDjDQlWN3YdThrk2hGKLtrAlocB5dl9SQpkkM-TIUJLNirJN24r67XNZPdIPZHily2atatFasYMoMpxV2T46XOBisRnxBQ4dPuSQKQkOaPtABtMdQ93YJ5PaZitC4ezY39k6_8HWP5ietHNP2j1J1WSKrIRGaSPJkOx5pbsXjhHpD7oauv0DTIt1YcE5qcLfUqgbXahDnbz-Nt1t87vXr0pNtX5sKvimCwVaCTjzL2AMm8EFHwghfIdzh4_O4TK6hjPfhTH43jkyTGitLUH5Ar3_ATaD0XOewWaQ9xL-mfF3y6quZUbeLw2tCq2QYdxYAb7DfJf53sk6eW-pU0J1pVVNRz071YGUIckVdf2vdWNyujU6b7fphnHLtQFJte1m3W4QqnaqvfHPYedfYPdV2OvB_Bj2XoUvjuB09-5nAAAA__-kyJCd
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk9FO4zoQhu_PU4zmpnBkVDvhAllCCqJBJ6iknLbSrkSrKiRD8ZLGWdsRRajvvkpSoO1StKD1hROP7d-f_xk_o_2Zo8RR2A_Px_AvXAwHV3ATfr_un0UxHPSi0Xj0f_8Qthek9yrPIIrjcAiXgyiGMjFUOBjEUM5UBqeQzpqfb_-FwxDSNib4FAYXF6NwDB4yLHRGcbIgi_IGBU4ZlkanZK02dei5WRBlS5ScoSrKytXhKcNUG0L5jE65nFDiOLnNaUhJRqbLkWFGLlF5I9uABk0_Kx_oCRme67xaFFY2VGwNigxHZVJHuxOcTJYnfIJdwbsckiIDAdrdk8HpiqGu3BuJdcmcUIoN9KiHkq_Y1-jFX6AP1uR7ab0dWrGX9g3SklFJDlWhTUaGsi3O6eqda8X6SJddb_tCfbVQDsReNL6D5n3GyEutirWP_vaxbXUG7efFyb7WD1UJP7QqQBcSDoJjOIVl55h3pJSB4Fzwk0M4i3twEHhwCoF_iAyHtNCOIH9nd_1glp2Tzf0Mlp10S_B3xdeUlm1KTXY7MzRXukCGg8pJCAQLPBb4e33zd3zzP-PbkGypC0s7Of2zDB2JOvmUzaktGKsrk9K10Wmzth0OGqEmkJF17azXDqKimRL1CYaSxWtFbiqJryrxXSXvQyV_S4lvKnm7Sv6HSsf7lXjt2F2uH-uXK5Gv29E73UvDekMyt3XaRvf6sZEdP5W16XdJbonhVfJAPXJkFqpQ1qkUpTMVrVb__AoAAP__93baww==

statement ok
SET vectorize=on
Expand Down Expand Up @@ -1048,7 +1048,7 @@ SELECT * FROM [EXPLAIN (DISTSQL) SELECT * FROM child LEFT JOIN parent ON p_id =
table: child@child_pkey
spans: [/'ca-central-1'/10 - /'ca-central-1'/10] [/'us-east-1'/10 - /'us-east-1'/10]
·
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJysk1Fr2zAQx9_3KY57STs0Ijt9KIKCS-uwFM_uHI8NGhNc62i9OpIny5BS8t1H5G6ts6bQbS-2dNL_9NP_Tg_Y_qhR4DyMwrMM3sM0TT7BVfjtMjqdxXBwPptn88_RIQw3lLdVLSEKpxlcJLMYmsKQspDE0CwrCSdQLt3g68cwDaHsYx7PIZlO52EGPjJUWlJcrKhFcYUe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QXOkcGYalk-AL5nvM7-zNZ2cnn52P5HNEttC5pZ1a_13ljkRlCkrn1BjJ6tIkdGV0Uq9thmEtVAdSsq6Z9ZpBP6-nRHWCoXjx4tRNJfFZJb6r5L2r1NlS4ptK3q5S512l4_1KvMrYbaYfqhctka_b0Rvdc8NqQzy3VdnGd_qhlq3cblHexpklhpfxPXXJkVmoXFmnEpTOlLRa_fc7AAD__0CL4Qg=

statement ok
SET vectorize=on
Expand Down
4 changes: 4 additions & 0 deletions pkg/jobs/jobsprofiler/profilerconstants/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ go_library(
srcs = ["constants.go"],
importpath = "github.com/cockroachdb/cockroach/pkg/jobs/jobsprofiler/profilerconstants",
visibility = ["//visibility:public"],
deps = [
"//pkg/util/uuid",
"@com_github_cockroachdb_errors//:errors",
],
)

get_x_data(name = "get_x_data")
32 changes: 31 additions & 1 deletion pkg/jobs/jobsprofiler/profilerconstants/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,14 @@

package profilerconstants

import "fmt"
import (
"fmt"
"strconv"
"strings"

"github.com/cockroachdb/cockroach/pkg/util/uuid"
"github.com/cockroachdb/errors"
)

const DSPDiagramInfoKeyPrefix = "~dsp-diag-url-"

Expand All @@ -31,3 +38,26 @@ func MakeNodeProcessorProgressInfoKey(
// The info key is of the form: <prefix>-<flowID>,<instanceID>,<processorID>.
return fmt.Sprintf("%s%s,%s,%d", NodeProcessorProgressInfoKeyPrefix, flowID, instanceID, processorID), nil
}

// GetNodeProcessorProgressInfoKeyParts deconstructs the passed in info key and
// returns the referenced flowID, instanceID and processorID.
func GetNodeProcessorProgressInfoKeyParts(infoKey string) (uuid.UUID, int, int, error) {
parts := strings.Split(strings.TrimPrefix(infoKey, NodeProcessorProgressInfoKeyPrefix), ",")
if len(parts) != 3 {
return uuid.Nil, 0, 0, errors.AssertionFailedf("expected 3 parts in info key but found %d: %v", len(parts), parts)
}
flowID, err := uuid.FromString(parts[0])
if err != nil {
return uuid.Nil, 0, 0, err
}
instanceID, err := strconv.Atoi(parts[1])
if err != nil {
return uuid.Nil, 0, 0, err
}
processorID, err := strconv.Atoi(parts[2])
if err != nil {
return uuid.Nil, 0, 0, err
}

return flowID, instanceID, processorID, nil
}
1 change: 1 addition & 0 deletions pkg/sql/delegate/show_jobs.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ SELECT job_id, job_type, description, statement, user_name, status,
if n.Options != nil {
if n.Options.ExecutionDetails {
baseQuery.WriteString(`, NULLIF(crdb_internal.job_execution_details(job_id)->>'plan_diagram'::STRING, '') AS plan_diagram`)
baseQuery.WriteString(`, NULLIF(crdb_internal.job_execution_details(job_id)->>'per_component_fraction_progressed'::STRING, '') AS component_fraction_progressed`)
}
}

Expand Down
Loading

0 comments on commit 88f311d

Please sign in to comment.