mirror of
https://github.com/scylladb/scylladb.git
synced 2026-04-22 01:20:39 +00:00
In order to improve materialized views' debuggability, tracing points are added to view update generation path.
Example trace:
```
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------------------------+-----------+----------------+-----------
Execute CQL3 query | 2020-04-27 13:13:46.834000 | 127.0.0.1 | 0 | 127.0.0.1
Parsing a statement [shard 0] | 2020-04-27 13:13:46.834346 | 127.0.0.1 | 1 | 127.0.0.1
Processing a statement [shard 0] | 2020-04-27 13:13:46.834426 | 127.0.0.1 | 80 | 127.0.0.1
Creating write handler for token: -3248873570005575792 natural: {127.0.0.1, 127.0.0.3} pending: {} [shard 0] | 2020-04-27 13:13:46.834494 | 127.0.0.1 | 148 | 127.0.0.1
Creating write handler with live: {127.0.0.3, 127.0.0.1} dead: {} [shard 0] | 2020-04-27 13:13:46.834507 | 127.0.0.1 | 161 | 127.0.0.1
Sending a mutation to /127.0.0.3 [shard 0] | 2020-04-27 13:13:46.834519 | 127.0.0.1 | 173 | 127.0.0.1
Executing a mutation locally [shard 0] | 2020-04-27 13:13:46.834532 | 127.0.0.1 | 186 | 127.0.0.1
View updates for ks.t require read-before-write - base table reader is created [shard 0] | 2020-04-27 13:13:46.834570 | 127.0.0.1 | 224 | 127.0.0.1
Reading key {{-3248873570005575792, pk{000400000002}}} from sstable /home/sarna/.ccm/scylla-1/node1/data/ks/t-162ef290887811eaa4bf000000000000/mc-1-big-Data.db [shard 0] | 2020-04-27 13:13:46.834608 | 127.0.0.1 | 262 | 127.0.0.1
/home/sarna/.ccm/scylla-1/node1/data/ks/t-162ef290887811eaa4bf000000000000/mc-1-big-Index.db: scheduling bulk DMA read of size 8 at offset 0 [shard 0] | 2020-04-27 13:13:46.834635 | 127.0.0.1 | 289 | 127.0.0.1
/home/sarna/.ccm/scylla-1/node1/data/ks/t-162ef290887811eaa4bf000000000000/mc-1-big-Index.db: finished bulk DMA read of size 8 at offset 0, successfully read 8 bytes [shard 0] | 2020-04-27 13:13:46.834975 | 127.0.0.1 | 629 | 127.0.0.1
Message received from /127.0.0.1 [shard 0] | 2020-04-27 13:13:46.834988 | 127.0.0.3 | 11 | 127.0.0.1
/home/sarna/.ccm/scylla-1/node1/data/ks/t-162ef290887811eaa4bf000000000000/mc-1-big-Data.db: scheduling bulk DMA read of size 41 at offset 0 [shard 0] | 2020-04-27 13:13:46.835015 | 127.0.0.1 | 669 | 127.0.0.1
View updates for ks.t require read-before-write - base table reader is created [shard 0] | 2020-04-27 13:13:46.835020 | 127.0.0.3 | 44 | 127.0.0.1
Generated 1 view update mutations [shard 0] | 2020-04-27 13:13:46.835080 | 127.0.0.3 | 104 | 127.0.0.1
Sending view update for ks.t_v2_idx_index to 127.0.0.2, with pending endpoints = {}; base token = -3248873570005575792; view token = 3728482343045213994 [shard 0] | 2020-04-27 13:13:46.835095 | 127.0.0.3 | 119 | 127.0.0.1
Sending a mutation to /127.0.0.2 [shard 0] | 2020-04-27 13:13:46.835105 | 127.0.0.3 | 129 | 127.0.0.1
View updates for ks.t were generated and propagated [shard 0] | 2020-04-27 13:13:46.835117 | 127.0.0.3 | 141 | 127.0.0.1
/home/sarna/.ccm/scylla-1/node1/data/ks/t-162ef290887811eaa4bf000000000000/mc-1-big-Data.db: finished bulk DMA read of size 41 at offset 0, successfully read 41 bytes [shard 0] | 2020-04-27 13:13:46.835160 | 127.0.0.1 | 813 | 127.0.0.1
Sending mutation_done to /127.0.0.1 [shard 0] | 2020-04-27 13:13:46.835164 | 127.0.0.3 | 188 | 127.0.0.1
Mutation handling is done [shard 0] | 2020-04-27 13:13:46.835177 | 127.0.0.3 | 201 | 127.0.0.1
Generated 1 view update mutations [shard 0] | 2020-04-27 13:13:46.835215 | 127.0.0.1 | 869 | 127.0.0.1
Locally applying view update for ks.t_v2_idx_index; base token = -3248873570005575792; view token = 3728482343045213994 [shard 0] | 2020-04-27 13:13:46.835226 | 127.0.0.1 | 880 | 127.0.0.1
Successfully applied local view update for 127.0.0.1 and 0 remote endpoints [shard 0] | 2020-04-27 13:13:46.835253 | 127.0.0.1 | 907 | 127.0.0.1
View updates for ks.t were generated and propagated [shard 0] | 2020-04-27 13:13:46.835256 | 127.0.0.1 | 910 | 127.0.0.1
Got a response from /127.0.0.1 [shard 0] | 2020-04-27 13:13:46.835274 | 127.0.0.1 | 928 | 127.0.0.1
Delay decision due to throttling: do not delay, resuming now [shard 0] | 2020-04-27 13:13:46.835276 | 127.0.0.1 | 930 | 127.0.0.1
Mutation successfully completed [shard 0] | 2020-04-27 13:13:46.835279 | 127.0.0.1 | 933 | 127.0.0.1
Done processing - preparing a result [shard 0] | 2020-04-27 13:13:46.835286 | 127.0.0.1 | 941 | 127.0.0.1
Message received from /127.0.0.3 [shard 0] | 2020-04-27 13:13:46.835331 | 127.0.0.2 | 14 | 127.0.0.1
Sending mutation_done to /127.0.0.3 [shard 0] | 2020-04-27 13:13:46.835399 | 127.0.0.2 | 82 | 127.0.0.1
Mutation handling is done [shard 0] | 2020-04-27 13:13:46.835413 | 127.0.0.2 | 96 | 127.0.0.1
Got a response from /127.0.0.2 [shard 0] | 2020-04-27 13:13:46.835639 | 127.0.0.3 | 662 | 127.0.0.1
Delay decision due to throttling: do not delay, resuming now [shard 0] | 2020-04-27 13:13:46.835640 | 127.0.0.3 | 664 | 127.0.0.1
Successfully applied view update for 127.0.0.2 and 1 remote endpoints [shard 0] | 2020-04-27 13:13:46.835649 | 127.0.0.3 | 673 | 127.0.0.1
Got a response from /127.0.0.3 [shard 0] | 2020-04-27 13:13:46.835841 | 127.0.0.1 | 1495 | 127.0.0.1
Request complete | 2020-04-27 13:13:46.834944 | 127.0.0.1 | 944 | 127.0.0.1
```
Fixes #6175
Tests: unit(dev), manual
* psarna-propagate_tracing_to_more_write_paths:
db,view: add tracing to view update generation path
treewide: propagate trace state to write path