Fingerprint runtime stats master - #6121
Conversation
roborivers
left a comment
There was a problem hiding this comment.
Cbuild submission: Error ⚠.
Regression testing: Success ✓.
The first 10 failing tests are:
sc_truncate_multiddl_generated [db unavailable at finish] **quarantined**
cdb2jdbc
ssl_san
consumer_non_atomic_default_consumer_generated **quarantined**
ssl_set_cmd
ssl_prefer
ssl_dbname
sc_downgrade [timeout] **quarantined**
phys_rep_tiered [timeout]
phys_rep_tiered_firstfile_generated [timeout]
dc97e20 to
cd17022
Compare
roborivers
left a comment
There was a problem hiding this comment.
Cbuild submission: Success ✓.
Regression testing: Success ✓.
The first 10 failing tests are:
sc_resume_logicalsc_generated **quarantined**
cdb2jdbc
timepart_noneres
consumer_non_atomic_default_consumer_generated **quarantined**
sc_downgrade [timeout] **quarantined**
phys_rep_tiered_firstfile_generated [timeout]
phys_rep_tiered_nosource_generated [timeout]
phys_rep_tiered [timeout]
reco-ddlk-sql [timeout] **quarantined**
roborivers
left a comment
There was a problem hiding this comment.
Cbuild submission: Success ✓.
Regression testing: Success ✓.
The first 10 failing tests are:
truncatesc_offline_generated **quarantined**
cdb2jdbc
fingerprints
consumer_non_atomic_default_consumer_generated **quarantined**
sc_downgrade [timeout] **quarantined**
phys_rep_tiered [timeout]
phys_rep_tiered_nosource_generated [timeout]
phys_rep_tiered_firstfile_generated [timeout]
reco-ddlk-sql [timeout] **quarantined**
33c96b2 to
5e040f8
Compare
roborivers
left a comment
There was a problem hiding this comment.
Cbuild submission: Error ⚠.
Regression testing: Success ✓.
The first 10 failing tests are:
cdb2jdbc
ssl_san
consumer_non_atomic_default_consumer_generated **quarantined**
ssl_set_cmd
ssl_prefer
ssl_dbname
sc_downgrade [timeout] **quarantined**
phys_rep_tiered [timeout]
phys_rep_tiered_firstfile_generated [timeout]
phys_rep_tiered_nosource_generated [timeout]
roborivers
left a comment
There was a problem hiding this comment.
Cbuild submission: Success ✓.
Regression testing: Success ✓.
The first 10 failing tests are:
sc_truncate [db unavailable at finish]
cdb2jdbc
sc_parallel_logicalsc_generated
consumer_non_atomic_default_consumer_generated **quarantined**
sc_downgrade [timeout] **quarantined**
phys_rep_tiered [timeout]
phys_rep_tiered_nosource_generated [timeout]
phys_rep_tiered_firstfile_generated [timeout]
truncatesc_offline_generated [timeout] **quarantined**
reco-ddlk-sql [timeout] **quarantined**
roborivers
left a comment
There was a problem hiding this comment.
Cbuild submission: Success ✓.
Regression testing: Success ✓.
The first 10 failing tests are:
cdb2jdbc
consumer_non_atomic_default_consumer_generated **quarantined**
fdb_push
sc_downgrade [timeout] **quarantined**
phys_rep_tiered [timeout]
phys_rep_tiered_firstfile_generated [timeout]
phys_rep_tiered_nosource_generated [timeout]
5e040f8 to
c33ede1
Compare
roborivers
left a comment
There was a problem hiding this comment.
Cbuild submission: Error ⚠.
Regression testing: Success ✓.
The first 10 failing tests are:
sc_truncate [db unavailable at finish]
cdb2jdbc
consumer_non_atomic_default_consumer_generated **quarantined**
sc_downgrade [timeout] **quarantined**
c33ede1 to
7bf9eb8
Compare
roborivers
left a comment
There was a problem hiding this comment.
Cbuild submission: Error ⚠.
Regression testing: Success ✓.
The first 10 failing tests are:
incoherent_slow **quarantined**
cdb2jdbc
ssl_san
consumer_non_atomic_default_consumer_generated **quarantined**
ssl_set_cmd
ssl_prefer
ssl_dbname
sc_downgrade [timeout] **quarantined**
reco-ddlk-sql [timeout] **quarantined**
Part 2 of the fingerprint runtime-stats effort (read side: PR bloomberg#6085). Writes are applied on the master's block-processor thread, which never received the fingerprint, so write-apply page-ins all landed in the NO-FINGERPRINT bucket. Add an append-only OSQL_FINGERPRINT op: the replicant sends it when the statement's fingerprint changes, the master arms a per-thread write-mode slot, and berkdb counts write-apply page-ins into new comdb2_fingerprints columns. Gated by gbl_osql_send_fingerprint, default OFF -- an older master rejects the unknown op. Signed-off-by: Mark Hannum <mhannum@bloomberg.net>
Skip the OSQL_FINGERPRINT send when the fingerprint is all-zeros (a statement with no normalized SQL), which would pool unrelated write I/O under one key. Plus comment fixes from review. Signed-off-by: Mark Hannum <mhannum@bloomberg.net>
RECOM / SNAPISOL / SERIAL drain buffered writes at commit under a single USEDB, interleaving statements, so the fingerprint must travel per row instead of riding the USEDB as in SOSQL. Record each row's fingerprint in a per-shad_tbl side hash (seq for ins/upd, genid for del) and emit OSQL_FINGERPRINT during the drain when it changes. The master apply path is unchanged. Signed-off-by: Mark Hannum <mhannum@bloomberg.net>
Add t12 (fpwrite.sh): enable osql_send_fingerprint, issue writes, and assert on the master that the statement's fingerprint carries write-apply page-ins. Structural invariants only, since page counts are not deterministic. Signed-off-by: Mark Hannum <mhannum@bloomberg.net>
…on levels Add t13 (fpwrite2.sh) covering read committed, snapshot isolation, and serial -- the levels that drain writes from shadow tables at commit. The rows it updates and deletes must pre-exist: a row inserted and deleted in one transaction cancels in the shadow table and never reaches the master. Signed-off-by: Mark Hannum <mhannum@bloomberg.net>
7bf9eb8 to
2cb22c4
Compare
Fingerprint runtime stats: attribute write-apply I/O on the master
Summary
Part 2 of the fingerprint runtime-stats work (read-side landed in #6085).
The read-side attributes bufferpool page-in I/O to a SQL fingerprint on the node
that runs the SQL engine. Writes, though, are offloaded and applied on the
replication master's block-processor thread, which never armed the fingerprint
TLS and never received the fingerprint — so all write-apply page-ins fell into
the NO-FINGERPRINT bucket.
This transmits the originating statement's fingerprint to the master and
attributes the write-apply I/O it generates.
What changed
OSQL_FINGERPRINTosql op carrying the 16-byte fingerprint(rqid + uuid wire variants, mirroring
OSQL_USEDB).osql_send_usedb_logic_int, ahead of the usedbdedup, only when the statement's fingerprint changes within the session —
correct per-statement attribution in multi-statement transactions.
(
osql_process_packet) and clears it once the session finishes applying.(
n_write_pagein_read/_io) via a per-thread write-mode flag paired withthe fingerprint TLS, so read vs write-apply I/O stays distinguishable.
comdb2_fingerprintsgainstotal_write_pagein_read,total_write_pagein_read_ioand ahas_query_infoflag, and now alsosurfaces fingerprints known only via write-apply (no
gbl_fingerprint_hashentry) — e.g. on a master that never ran the statement's SQL engine.
Rollout
Gated by
gbl_osql_send_fingerprint, default off. There is no osql protocolhandshake: an un-upgraded master fails the transaction on the unknown op. Keep
it off until the whole cluster is upgraded, then enable at runtime with
put tunable 'osql_send_fingerprint' 1(or via lrl).Testing
tests/fingerprints.testt12 (driven byfpwrite.sh): enables the tunable,issues writes, then asserts on the master — by fingerprint hash — that the
write-apply counters are populated (
total_write_pagein_read > 0,total_write_pagein_read_io <= total_write_pagein_read). Structural invariantsonly, since exact page counts are not deterministic. Full suite passes.