Skip to content
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: handle errors on db endpoints #90862

Merged
merged 1 commit into from
Oct 31, 2022
Merged

Conversation

maryliag
Copy link
Contributor

@maryliag maryliag commented Oct 28, 2022

Previously, when hitting an error on endpoints
used on the database page, we would just keep retrying constantly, without showing a proper error state.
On SQL Activity page, for example, we show the error message and let the user retry if they want.
This commit uses the same logic on the Database page. Since the pages make several requests and just part of them can fail, some of the pages we will still load, but give a warning about unavailable data and show the error message about reload option.

This commit also increases timeout of database endpoints.

Fixes #90596

Screen Shot 2022-10-28 at 6 28 55 PM

Screen Shot 2022-10-28 at 6 29 30 PM

https://www.loom.com/share/edc46386a6fe408b90fa5b6330870819

Release note: None

@maryliag maryliag requested a review from a team October 28, 2022 19:09
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@maryliag maryliag force-pushed the db-timeout branch 3 times, most recently from f4a7bbd to 2e7cb94 Compare October 28, 2022 23:08
Previously, when hitting an error on endpoints
used on the database page, we would just keep retrying
constantly, without showing a proper error state.
On SQL Activity page, for example, we show the error
message and let the user retry if they want.
This commit uses the same logic on the Database page.
Since the pages make several requests and just part of
them can fail, some of the pages we will still load, but
give a warning about unavailable data and show the error
message about reload option.

This commit also increases timeout of database endpoints.

Fixes cockroachdb#90596

Release note: None
Copy link
Contributor

@matthewtodd matthewtodd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@maryliag
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Oct 31, 2022

Build succeeded:

@craig craig bot merged commit c476f0d into cockroachdb:master Oct 31, 2022
@blathers-crl
Copy link

blathers-crl bot commented Oct 31, 2022

Encountered an error creating backports. Some common things that can go wrong:

  1. The backport branch might have already existed.
  2. There was a merge conflict.
  3. The backport branch contained merge commits.

You might need to create your backport manually using the backport tool.


error creating merge commit from 35caa9e to blathers/backport-release-22.1-90862: 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 22.1.x failed. See errors above.


error creating merge commit from 35caa9e to blathers/backport-release-22.2-90862: 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 22.2.x failed. See errors above.


🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@nvanbenschoten
Copy link
Member

Hey @maryliag 👋 It looks like this change broke CI's check generated code job. We're now seeing failures like the following:

src/databaseDetailsPage/databaseDetailsPage.stories.tsx(32,7): error TS2322: Type '{ loading: true; loaded: false; name: string; tables: undefined[]; viewMode: ViewMode.Tables; sortSettingTables: { ascending: false; columnTitle: string; }; sortSettingGrants: { ascending: false; columnTitle: string; }; ... 7 more ...; match: { ...; }; }' is not assignable to type 'DatabaseDetailsPageProps'.
  Property 'lastError' is missing in type '{ loading: true; loaded: false; name: string; tables: undefined[]; viewMode: ViewMode.Tables; sortSettingTables: { ascending: false; columnTitle: string; }; sortSettingGrants: { ascending: false; columnTitle: string; }; ... 7 more ...; match: { ...; }; }' but required in type 'DatabaseDetailsPageData'.
src/databaseDetailsPage/databaseDetailsPage.stories.tsx(61,7): error TS2322: Type '{ loading: false; loaded: true; name: string; tables: undefined[]; viewMode: ViewMode.Tables; sortSettingTables: { ascending: false; columnTitle: string; }; sortSettingGrants: { ascending: false; columnTitle: string; }; ... 7 more ...; match: { ...; }; }' is not assignable to type 'DatabaseDetailsPageProps'.
  Property 'lastError' is missing in type '{ loading: false; loaded: true; name: string; tables: undefined[]; viewMode: ViewMode.Tables; sortSettingTables: { ascending: false; columnTitle: string; }; sortSettingGrants: { ascending: false; columnTitle: string; }; ... 7 more ...; match: { ...; }; }' but required in type 'DatabaseDetailsPageData'.
src/databaseDetailsPage/databaseDetailsPage.stories.tsx(98,5): error TS2741: Property 'lastError' is missing in type '{ loading: false; loaded: true; columnCount: number; indexCount: number; userCount: number; roles: string[]; grants: string[]; statsLastUpdated: moment.Moment; hasIndexRecommendations: false; livePercentage: number; liveBytes: number; totalBytes: number; }' but required in type 'DatabaseDetailsPageDataTableDetails'.
src/databaseDetailsPage/databaseDetailsPage.stories.tsx(112,5): error TS2741: Property 'lastError' is missing in type '{ loading: false; loaded: true; replicationSizeInBytes: number; rangeCount: number; nodesByRegionString: string; }' but required in type 'DatabaseDetailsPageDataTableStats'.
src/databaseDetailsPage/databaseDetailsPage.stories.tsx(123,7): error TS2322: Type '{ loading: false; loaded: true; name: string; tables: DatabaseDetailsPageDataTable[]; viewMode: ViewMode.Tables; sortSettingTables: { ascending: false; columnTitle: string; }; ... 8 more ...; match: { ...; }; }' is not assignable to type 'DatabaseDetailsPageProps'.
  Property 'lastError' is missing in type '{ loading: false; loaded: true; name: string; tables: DatabaseDetailsPageDataTable[]; viewMode: ViewMode.Tables; sortSettingTables: { ascending: false; columnTitle: string; }; ... 8 more ...; match: { ...; }; }' but required in type 'DatabaseDetailsPageData'.
src/databaseTablePage/databaseTablePage.stories.tsx(29,3): error TS2741: Property 'lastError' is missing in type '{ loading: true; loaded: false; createStatement: string; replicaCount: number; indexNames: undefined[]; grants: undefined[]; statsLastUpdated: moment.Moment; livePercentage: number; liveBytes: number; totalBytes: number; }' but required in type 'DatabaseTablePageDataDetails'.
src/databaseTablePage/databaseTablePage.stories.tsx(41,3): error TS2741: Property 'lastError' is missing in type '{ loading: true; loaded: false; sizeInBytes: number; rangeCount: number; }' but required in type 'DatabaseTablePageDataStats'.
src/databaseTablePage/databaseTablePage.stories.tsx(47,3): error TS2741: Property 'lastError' is missing in type '{ loading: true; loaded: false; stats: undefined[]; lastReset: moment.Moment; }' but required in type 'DatabaseTablePageIndexStats'.
src/databaseTablePage/databaseTablePage.stories.tsx(74,3): error TS2741: Property 'lastError' is missing in type '{ loading: false; loaded: true; createStatement: string; replicaCount: number; indexNames: string[]; grants: { user: string; privilege: string; }[]; statsLastUpdated: moment.Moment; livePercentage: number; liveBytes: number; totalBytes: number; }' but required in type 'DatabaseTablePageDataDetails'.
src/databaseTablePage/databaseTablePage.stories.tsx(102,3): error TS2741: Property 'lastError' is missing in type '{ loading: false; loaded: true; sizeInBytes: number; rangeCount: number; nodesByRegionString: string; }' but required in type 'DatabaseTablePageDataStats'.
src/databaseTablePage/databaseTablePage.stories.tsx(110,3): error TS2741: Property 'lastError' is missing in type '{ loading: false; loaded: true; stats: { totalReads: number; lastUsed: moment.Moment; lastUsedType: string; indexName: string; indexRecommendations: { type: "DROP_UNUSED"; reason: string; }[]; }[]; lastReset: moment.Moment; }' but required in type 'DatabaseTablePageIndexStats'.
src/databasesPage/databasesPage.stories.tsx(22,7): error TS2322: Type '{ loading: true; loaded: false; automaticStatsCollectionEnabled: true; databases: undefined[]; sortSetting: { ascending: false; columnTitle: string; }; onSortingChange: () => void; refreshDatabases: () => void; ... 5 more ...; match: { ...; }; }' is not assignable to type 'DatabasesPageProps'.
  Property 'lastError' is missing in type '{ loading: true; loaded: false; automaticStatsCollectionEnabled: true; databases: undefined[]; sortSetting: { ascending: false; columnTitle: string; }; onSortingChange: () => void; refreshDatabases: () => void; ... 5 more ...; match: { ...; }; }' but required in type 'DatabasesPageData'.
src/databasesPage/databasesPage.stories.tsx(46,7): error TS2322: Type '{ loading: false; loaded: true; automaticStatsCollectionEnabled: true; databases: undefined[]; sortSetting: { ascending: false; columnTitle: string; }; onSortingChange: () => void; refreshDatabases: () => void; ... 5 more ...; match: { ...; }; }' is not assignable to type 'DatabasesPageProps'.
  Property 'lastError' is missing in type '{ loading: false; loaded: true; automaticStatsCollectionEnabled: true; databases: undefined[]; sortSetting: { ascending: false; columnTitle: string; }; onSortingChange: () => void; refreshDatabases: () => void; ... 5 more ...; match: { ...; }; }' but required in type 'DatabasesPageData'.
src/databasesPage/databasesPage.stories.tsx(79,3): error TS2322: Type '{ loading: false; loaded: true; name: string; sizeInBytes: number; tableCount: number; rangeCount: number; missingTables: any[]; nodesByRegionString: string; numIndexRecommendations: number; }[]' is not assignable to type 'DatabasesPageDataDatabase[]'.
  Property 'lastError' is missing in type '{ loading: false; loaded: true; name: string; sizeInBytes: number; tableCount: number; rangeCount: number; missingTables: any[]; nodesByRegionString: string; numIndexRecommendations: number; }' but required in type 'DatabasesPageDataDatabase'.
error Command failed with exit code 2.

Do you mind taking a look?

maryliag added a commit to maryliag/cockroach that referenced this pull request Nov 1, 2022
The PR cockroachdb#90862 introduced an error on generated code.
This PR fixes the missing parameters used for tests.

Epic: None

Release note: None
@maryliag maryliag deleted the db-timeout branch November 1, 2022 13:45
maryliag added a commit to maryliag/cockroach that referenced this pull request Nov 1, 2022
The PR cockroachdb#90862 introduced an error on generated code.
This PR fixes the missing parameters used for tests.

Epic: None

Release note: None
craig bot pushed a commit that referenced this pull request Nov 1, 2022
89778: schemachanger: Enable adding/dropping path of check constraints r=Xiang-Gu a=Xiang-Gu

See each commit message for deatils.

Commit 1 (easy to review): Fixed a careless bug in existing code;

Commit 2 (easy to review): Added a bool field, `FromHashShardedIndex`, in the protobuf
definition of the `CheckConstraint` element.

Commit 3 (meaty commit): Enable adding/dropping path of check constraints.
```
ABSENT <==> WRITE_ONLY <==> VALIDATED <==> PUBLIC
```

Informs #89665


90956: builtins: add timestamp to crdb_internal.scan/list_sql_keys_in_range r=stevendanna a=adityamaru

This change adds a third return column to the builtins
that corresponds to the timestamp at which the value for
a particular key was written.

Release note (sql change): `crdb_internal.scan` and
`crdb_internal.list_sql_keys_in_range` return
the timestamp at which the value for a key was written, in
addition to the raw key and value.

91024: backupccl: ensure restore2TB/nodes=10/with-pause pauses at least once r=msbutler a=msbutler

This patch adds a check that will cause the roachtest to fail if the job was not paused at least once.

Release note: None

Epic: none

91055: test: fix error on test r=maryliag a=maryliag

The PR #90862 introduced an error on generated code. This PR fixes the missing parameters used for tests.

Epic: None

Release note: None

91061: bazci: fix issue posting r=nicktrav a=rickystewart

This block got accidentally deleted in
`61161542c910d82c86e4c8ccb6fd2946bba9ab8d`.

Release note: None
Epic: None

Co-authored-by: Xiang Gu <[email protected]>
Co-authored-by: adityamaru <[email protected]>
Co-authored-by: Michael Butler <[email protected]>
Co-authored-by: maryliag <[email protected]>
Co-authored-by: Ricky Stewart <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui: back off making new requests if receiving a 504
4 participants