Skip to content

Commit

Permalink
sql: add kv nodes to makeDeterministic method
Browse files Browse the repository at this point in the history
This patch adds `KVStats.NodeIDs` to `ComponentStats.MakeDeterministic`
in order to prevent test flakes.

Fixes cockroachdb#124909

Release note: None
  • Loading branch information
DrewKimball committed Jun 3, 2024
1 parent ba6c79e commit f5dc4e2
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 17 deletions.
5 changes: 5 additions & 0 deletions pkg/sql/execinfrapb/component_stats.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,11 @@ func (s *ComponentStats) MakeDeterministic() {
// BatchRequestsIssued is overridden to a useful value for tests.
s.KV.BatchRequestsIssued.Set(s.KV.TuplesRead.Value())
}
if len(s.KV.NodeIDs) > 0 {
// The nodes can be non-deterministic because they depend on the actual
// cluster configuration. Override to a useful value for tests.
s.KV.NodeIDs = []int32{1}
}

// Exec.
timeVal(&s.Exec.ExecTime)
Expand Down
4 changes: 2 additions & 2 deletions pkg/sql/opt/exec/execbuilder/testdata/dist_vectorize
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ quality of service: regular
table: kv@kv_pkey
spans: FULL SCAN
·
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzsl89u4zYQxu99CmJOSSHD-mfH4Wlb7xYI2iQL27s9FEHASLNawhKpklRsN_Bj9QX6ZIWkKJXktWC5KHyofQhAcjT6-M1vROYF9O8xUJh_-OXDdEECmQlz8f0l-Wl2f0uWz2CBkCHesQQ10N_AAQtcsMADC3ywYAQPFqRKBqi1VHnIS_HATbgGalvARZqZfPrBgkAqBPoChpsYgcKCPcU4QxaiGtpgQYiG8bh4zfL53fL5MV3iBiyYyjhLhKZgwTxlQlMyGOYafv5M8ldpSoRTDhVGXOYBBrUppwxPkBL7rz91OQ6kMCgMl2JnScmVJiEGMsSQkteUTxuDmihkISUT8mM5Gc0-TknA4li_xaWMqyouF3f7eTol2mBaWkoucG2GXJhLSuxit2UA4nJfQMLWJMFEqg1hcSwDZn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eTu_08nRJtMC0lJRe4NkMuzCUldrHbMgFxuS8hYWuSYCLVhrA4lgEzOS274PDETPAVNZGZSTNDSZ5f0K8mHHjYWlCOXuXXhkUI1KnV6-Y9UHtrHV6yH6JIYcSMVMNRs2LT-093i8fZ_a_zi0uwANcYZLsq_wvebov3aC_vf-hmQqoQFYYNrg_b7p05LTPOP90-3twtLt45_83OvNbOnGZJnMO7yOnVRUN3MPTOfXSkPnL6FK3mtvGJ-2jc4O0ebja3n9m8wdA_m-1IZnP7FK1mtqsTm-2qwds73GxeP7P5g-J8OpvtGGbz-hStZrbJic02afD2Dzeb389so8HZakeymt-nZDWrXZ_Yatd9LtEz1KkUGluX0m-vZLdWGjj57RXDCMurrpaZCvCjkkGRWw7vC6BiIkRtyqhTDm5EFdJGIUve_gPUkZxOJLeB5NSRRm0kt5tTH1JeJ5S_H8lpI_l9t8eKqoBAs5JqSWJmUASbNydV8yvGTdNjIWpUnMX8D7ZrwOq1wnQKA-TPVbNXoarjq1jZ9VU0Qa1Z1EiwDzR2XZ9xW59Rpz7j_Uq7baTxWem6Pldtfa469ZnsV9prI03OStf1mbT1ue7-ENn7pfZ3vo7dH9r_ndbX-ZH0JZarRx4CBfv1GXzjp3ogf4FFOj8X51_lqhBrsUnzU-0LizVacMuW-B4NqoQLrg0PgBqV4Xb73d8BAAD__2pJxf8=

query T
EXPLAIN ANALYZE (DISTSQL) SELECT * FROM kv JOIN kw ON kv.k = kw.k
Expand Down Expand Up @@ -144,7 +144,7 @@ quality of service: regular
table: kw@kw_pkey
spans: FULL SCAN
·
Diagram: https://cockroachdb.github.io/distsqlplan/decode.html#eJzsmt9um0gUxu_3KUZz1W5x7eGPYyNVsjbtSulukiqJerOKqgmc2AjMuMzYjjfKY-0L7JOtgDoJxng9qB4sIBdVgQHm_M6cb74Z84j59wDb-PrTn59Ob9Cv6Pery3PkL9Dny7ML5C_R5QXyF-999AH5y_c-1nDIXLigU-DY_gsTrGEda9jAGjaxhi18q-FZxBzgnEVxk8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q28nrV1UsofZt8WMJ7VggHICqoqNpn5kvIkJ_SdNs0XCK807hA6GDcvP63-kgAdXt5vXvIGEJtc_NYwnVvtOvf82MRlS-RKh_araL0WA-VWyBWXWQgOp28_pVFUuofW4eS6j27X79qopGVL5EOABVLUZT-ACp5W7efrwx6F0kFt8Cn7p08OPX2_Jn9aPpBXwkqftAP4_FIqP1ZTkFSd07Hkkw6AUP4T0oSCZBHEgVeNRVyQweH__3TwAAAP__sPAEnQ==

query T
EXPLAIN (VEC, VERBOSE) SELECT count(*) FROM kv
Expand Down
Loading

0 comments on commit f5dc4e2

Please sign in to comment.