sql: fix namespace name resolution fallback code#43226
sql: fix namespace name resolution fallback code#43226craig[bot] merged 1 commit intocockroachdb:masterfrom
Conversation
b52e1bc to
a719d43
Compare
jordanlewis
left a comment
There was a problem hiding this comment.
Ah, makes sense. Is there any way you can add tests for this? It seems like a test that tries to resolve a database given a set of keys in the new state like our broken clusters were would fail in the old state and not after this fix.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @jordanlewis)
jordanlewis
left a comment
There was a problem hiding this comment.
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @jordanlewis)
Previously, the fallback for name resolution was broken. If an entry is not present in the new `system.namespace`, we should look it up in the old `system.namespace`. This was not happening, as we would only fallback to the old `system.namespace` if the entry was a table. Thus, databases created before the new `system.namespace` table was created were not being resolved at all. This PR fixes that. Fixes cockroachdb#43141 Release note: None
a719d43 to
96e87e2
Compare
arulajmani
left a comment
There was a problem hiding this comment.
TFTR. Added a test that accesses a database/table created before the version upgrade sequence starts. Decided to explicitly create these two objects, instead of using if not exists to closely mirror the state we were in.
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale)
jordanlewis
left a comment
There was a problem hiding this comment.
if you can confirm the test fails before the patch :)
Reviewable status:
complete! 1 of 0 LGTMs obtained
|
Test fails before the patch. Merging. bors r+ |
43147: closedts: shorten target_duration from 30s to 3s r=ajwerner a=ajwerner This PR dramatically shortens the closed timestamp target interval. With this setting the experimental_follower_read_timestamp() will now be 4.8 seconds in the past as opposed to the current 48 seconds in the past. This relatively aggressive setting of 3s is intended to shake out issues. This value has been verified to work on the `schemachange/mixed/tpcc` roachtest introduced in #39096 and for vanilla TPC-C runs around where we have established a baseline in the past using tpccbench. Specifically several runs at 2300 warehouses on 3x c5d.4xlarge nodes which is right at the passing boundary without the change were run only a very small difference in efficiency or tail latency was observed. It seems reasonable to attempt to live with this value on master for a while and see what happens. Fixes #37083. Release note (enterprise change): Shorten the default closed timestamp target interval from 30s to 3s leading to permit follower reads at 4.8 seconds in the past rather than the previous 48 seconds. 43226: sql: fix namespace name resolution fallback code r=arulajmani a=arulajmani Previously, the fallback for name resolution was broken. If an entry is not present in the new `system.namespace`, we should look it up in the old `system.namespace`. This was not happening, as we would only fallback to the old `system.namespace` if the entry was a table. Thus, databases created before the new `system.namespace` table was created were not being resolved at all. This PR fixes that. Fixes #43141 Release note: None Co-authored-by: Andrew Werner <ajwerner@cockroachlabs.com> Co-authored-by: arulajmani <arulajmani@gmail.com>
Build succeeded |
Previously, the fallback for name resolution was broken. If an entry
is not present in the new
system.namespace, we should look it upin the old
system.namespace. This was not happening, as we wouldonly fallback to the old
system.namespaceif the entry was a table.Thus, databases created before the new
system.namespacetable wascreated were not being resolved at all. This PR fixes that.
Fixes #43141
Release note: None