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

Catalog cache and Session update for async queries #1500

Merged
merged 5 commits into from
Mar 8, 2024

Conversation

ps48
Copy link
Member

@ps48 ps48 commented Mar 8, 2024

Description

Catalog cache and Session update for async queries

Issues Resolved

#1484
#1251

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

@ps48 ps48 added the enhancement New feature or request label Mar 8, 2024
@ps48 ps48 marked this pull request as ready for review March 8, 2024 18:03
Copy link

codecov bot commented Mar 8, 2024

Codecov Report

Attention: Patch coverage is 55.55556% with 96 lines in your changes are missing coverage. Please review.

Project coverage is 54.39%. Comparing base (290415a) to head (8ce818d).
Report is 1 commits behind head on main.

Files Patch % Lines
public/framework/catalog_cache/cache_loader.tsx 30.70% 79 Missing ⚠️
public/framework/catalog_cache/cache_intercept.ts 0.00% 7 Missing ⚠️
common/utils/shared.ts 61.53% 5 Missing ⚠️
common/utils/query_session_utils.ts 50.00% 2 Missing ⚠️
public/components/common/search/direct_search.tsx 0.00% 2 Missing ⚠️
public/plugin.tsx 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1500      +/-   ##
==========================================
+ Coverage   54.26%   54.39%   +0.13%     
==========================================
  Files         343      347       +4     
  Lines       12338    12563     +225     
  Branches     3173     3213      +40     
==========================================
+ Hits         6695     6834     +139     
- Misses       5587     5673      +86     
  Partials       56       56              
Flag Coverage Δ
dashboards-observability 54.39% <55.55%> (+0.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


const cachedDatabase = cachedDataSource.databases.find((db) => db.name === databaseName);
if (!cachedDatabase) {
throw new Error('Database not found exception: ' + databaseName);
Copy link
Collaborator

Choose a reason for hiding this comment

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

From an API usability standpoint, I wonder if it's good design to throw an error on a cache miss. Since it's a pretty regular and probably expected occurrence, it might make more sense to return a CachedDatabase | null (or reuse the ok: boolean pattern from AsyncApiResponse) so TypeScript can do more heavy lifting for soundness checking.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is by design right now. We want the cache users to know where the get request is failing. I'll check with @RyanL1997 @sejli what do they expect thrown error or an error response. I remember UI having special cases where they see something missing with toast errors or callouts.

test/datasources.ts Outdated Show resolved Hide resolved
public/framework/catalog_cache/cache_loader.test.tsx Outdated Show resolved Hide resolved
@paulstn paulstn self-requested a review March 8, 2024 22:57
@ps48 ps48 merged commit 943126f into opensearch-project:main Mar 8, 2024
16 of 20 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 8, 2024
* init commit for cache

Signed-off-by: Shenoy Pratik <[email protected]>

* cache loader init

Signed-off-by: Shenoy Pratik <[email protected]>

* update cache with accelerations cache, add custom hooks

Signed-off-by: Shenoy Pratik <[email protected]>

* add session coupling and fix tests for cache

Signed-off-by: Shenoy Pratik <[email protected]>

* added polling result type, updated version constant

Signed-off-by: Shenoy Pratik <[email protected]>

---------

Signed-off-by: Shenoy Pratik <[email protected]>
(cherry picked from commit 943126f)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
mengweieric pushed a commit that referenced this pull request Mar 9, 2024
* init commit for cache



* cache loader init



* update cache with accelerations cache, add custom hooks



* add session coupling and fix tests for cache



* added polling result type, updated version constant



---------


(cherry picked from commit 943126f)

Signed-off-by: Shenoy Pratik <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
amsiglan pushed a commit to amsiglan/dashboards-observability that referenced this pull request Jun 7, 2024
…t#1500) (opensearch-project#1504)

* init commit for cache

* cache loader init

* update cache with accelerations cache, add custom hooks

* add session coupling and fix tests for cache

* added polling result type, updated version constant

---------

(cherry picked from commit 943126f)

Signed-off-by: Shenoy Pratik <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
(cherry picked from commit b4c04d8)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants