-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ui: improve db page nodes/regions query #118904
ui: improve db page nodes/regions query #118904
Conversation
56b98e1
to
f2ac4b5
Compare
39fd668
to
ba6260f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @abarganier and @xinhaoz)
pkg/ui/workspaces/cluster-ui/src/databases/combiners.ts
line 82 at r2 (raw file):
const dbStats = dbDetails?.data?.results.stats; // TODO #118957 (xinhaoz) Use store id to regions mapping. const nodes = dbStats?.replicaData.storeIDs || [];
can this variable be stores
? or is that work that will be in a follow up PR? The way this reads suggests that if store and node IDs don't match the code won't work.
ba6260f
to
10b8c2a
Compare
Previously, dhartunian (David Hartunian) wrote…
Was planning on renaming it when resolving #118957, but I can change it now, too (have to repush anyways to resolve a test). |
10b8c2a
to
051c7b7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 2 of 4 files at r1, 3 of 3 files at r3, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @abarganier and @xinhaoz)
pkg/ui/workspaces/cluster-ui/src/api/databaseDetailsApi.ts
line 370 at r3 (raw file):
` SELECT array_agg(DISTINCT unnested) AS store_ids FROM [SHOW RANGES FROM DATABASE %1], unnest(replicas) AS unnested
nit: can you call this something more specific like unnested_store_ids
? Reading DISTINCT unnested
in the SELECT
is confusing.
pkg/ui/workspaces/cluster-ui/src/api/databaseDetailsApi.ts
line 383 at r3 (raw file):
resp.stats.replicaData.error = txn_result.error; } resp.stats.replicaData.storeIDs = txn_result?.rows[0]?.store_ids ?? [];
should we be returning from the error clause? and seeing .storeIDs
to empty there? Can we avoid some of the ?
in that case and assume we have some data?
This commit rewrites the query to fetch node and region information for a db in the databases page in db-console. The runtime of the query is improved by removing the expressions used to extract the region information in the `replica_locality` column of the ranges table since this field was not used in the client. The function `createMockDatabaseRangesForTable` in `fakeApi.ts` is also deleted as it has no callers. Part of: cockroachdb#114690 Release note: None
051c7b7
to
bcf2d35
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @abarganier and @dhartunian)
pkg/ui/workspaces/cluster-ui/src/api/databaseDetailsApi.ts
line 370 at r3 (raw file):
Previously, dhartunian (David Hartunian) wrote…
nit: can you call this something more specific like
unnested_store_ids
? ReadingDISTINCT unnested
in theSELECT
is confusing.
Done.
pkg/ui/workspaces/cluster-ui/src/api/databaseDetailsApi.ts
line 383 at r3 (raw file):
Previously, dhartunian (David Hartunian) wrote…
should we be returning from the error clause? and seeing
.storeIDs
to empty there? Can we avoid some of the?
in that case and assume we have some data?
I kept the previous behaviour of not returning on error since the error could be something where we can still show partial results (e.g. max size exceeded).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @abarganier)
tftr! |
Build succeeded: |
Encountered an error creating backports. Some common things that can go wrong:
You might need to create your backport manually using the backport tool. error creating merge commit from bcf2d35 to blathers/backport-release-23.1-118904: POST https://api.github.com/repos/cockroachdb/cockroach/merges: 409 Merge conflict [] you may need to manually resolve merge conflicts with the backport tool. Backport to branch 23.1.x failed. See errors above. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
These queries were updated in cockroachdb#118904 to make them more performant. In that change we mistakenly removed the null check before reading the `rows` field, causing pages using this request to crash if this query fails. Epic: none Fixes: cockroachdb#126348 Release note (bug fix): Database overview and db details pages should not crash if the range information is not available.
These queries were updated in cockroachdb#118904 to make them more performant. In that change we mistakenly removed the null check before reading the `rows` field, causing pages using this request to crash if this query fails. Epic: none Fixes: cockroachdb#126348 Release note (bug fix): Database overview and db details pages should not crash if the range information is not available.
126336: sql: override StmtTimeout to 0 for background jobs r=annrpom a=annrpom For background jobs and schema changes, our Internal Executor inherits from cluster settings. If a statement timeout is set cluster-wide, then background jobs will respect this -- which does not make much sense; thus, this patch overrides the StmtTimeout to 0s for background jobs. Fixes: #126261 Release note (bug fix): Background jobs no longer respect a statement timeout. 126419: ui: fix query fetching store ids for db/tables r=xinhaoz a=xinhaoz These queries were updated in #118904 to make them more performant. In that change we mistakenly removed the null check before reading the `rows` field, causing pages using this request to crash if this query fails. Epic: none Fixes: #126348 Release note (bug fix): Database overview and db details pages should not crash if the range information is not available. 126575: kv: add support for Lease.MinExpiration r=nvanbenschoten a=nvanbenschoten Closes #125235. This commit begins using the new `Lease.MinExpiration` field, which was introduced in 7781cfa. `Lease.MinExpiration` is assigned to epoch-based leases (and soon, leader leases) during upgrades from expiration-based lease. It is a simple, direct way to ensure that the expiration of the lease does not regress during such promotions. We previously solved this issue in 6dd54b4 by manually heartbeating the node liveness record when we detected an expiration regression. This was backwards compatible, so it was a better backport target, but it was also complex, as demonstrated by the need for b2ac52a. In the future, we will be able to remove the manual heartbeat logic, as it is no longer necessary once MinTimestamp is supported by all clusters. Epic: None Co-authored-by: Annie Pompa <[email protected]> Co-authored-by: Xin Hao Zhang <[email protected]> Co-authored-by: Nathan VanBenschoten <[email protected]>
These queries were updated in cockroachdb#118904 to make them more performant. In that change we mistakenly removed the null check before reading the `rows` field, causing pages using this request to crash if this query fails. Epic: none Fixes: cockroachdb#126348 Release note (bug fix): Database overview and db details pages should not crash if the range information is not available.
These queries were updated in cockroachdb#118904 to make them more performant. In that change we mistakenly removed the null check before reading the `rows` field, causing pages using this request to crash if this query fails. Epic: none Fixes: cockroachdb#126348 Release note (bug fix): Database overview and db details pages should not crash if the range information is not available.
These queries were updated in cockroachdb#118904 to make them more performant. In that change we mistakenly removed the null check before reading the `rows` field, causing pages using this request to crash if this query fails. Epic: none Fixes: cockroachdb#126348 Release note (bug fix): Database overview and db details pages should not crash if the range information is not available.
These queries were updated in cockroachdb#118904 to make them more performant. In that change we mistakenly removed the null check before reading the `rows` field, causing pages using this request to crash if this query fails. Epic: none Fixes: cockroachdb#126348 Release note (bug fix): Database overview and db details pages should not crash if the range information is not available.
These queries were updated in cockroachdb#118904 to make them more performant. In that change we mistakenly removed the null check before reading the `rows` field, causing pages using this request to crash if this query fails. Epic: none Fixes: cockroachdb#126348 Release note (bug fix): Database overview and db details pages should not crash if the range information is not available.
This commit rewrites the query to fetch node and region information for a db
in the databases page in db-console. The runtime of the query is improved
by removing the expressions used to extract the region information in the
replica_locality
column of the ranges table since this field was not usedin the client.
The function
createMockDatabaseRangesForTable
infakeApi.ts
is alsodeleted as it has no callers.
Part of: #114690
Release note: None
https://www.loom.com/share/cec82ea6c26849e28cfea31d66fdc719