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

Use new document store search api #255

Merged
merged 2 commits into from
Nov 21, 2024
Merged

Use new document store search api #255

merged 2 commits into from
Nov 21, 2024

Conversation

bhubam
Copy link
Contributor

@bhubam bhubam commented Nov 20, 2024

Description

Please include a summary of the change, motivation and context.

Testing

Please describe the tests that you ran to verify your changes. Please summarize what did you test and what needs to be tested e.g. deployed and tested helm chart locally.

Checklist:

  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • Any dependent changes have been merged and published in downstream modules

Documentation

Make sure that you have documented corresponding changes in this repository or hypertrace docs repo if required.

@bhubam bhubam requested a review from a team as a code owner November 20, 2024 16:16
Copy link

github-actions bot commented Nov 20, 2024

Test Results

134 tests  ±0   134 ✅ ±0   1m 1s ⏱️ -1s
 31 suites ±0     0 💤 ±0 
 31 files   ±0     0 ❌ ±0 

Results for commit 727854b. ± Comparison against base commit 385ac99.

♻️ This comment has been updated with latest results.

@@ -202,12 +209,11 @@ public Map<ConfigResourceContext, ContextSpecificConfig> getContextConfigs(
@Override
public List<ContextSpecificConfig> getAllConfigs(ConfigResource configResource)
throws IOException {
Query query = new Query();
query.setFilter(this.getConfigResourceFilter(configResource));

Choose a reason for hiding this comment

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

If getConfigResourceFilter isn't getting used anywhere else, can we get rid of it?

Query query = new Query();
query.setFilter(this.getConfigResourceFilter(configResource));
query.addOrderBy(new OrderBy(VERSION_FIELD_NAME, false));
org.hypertrace.core.documentstore.query.Query query = buildQuery(configResource);

Choose a reason for hiding this comment

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

If we have replaced all instance of Query, then, we can directly import this Query class instead of fully-qualifying it every time?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Old api was getting some other places also, moved to new one everywhere

@@ -94,7 +102,7 @@ public UpsertedConfig writeConfig(
.asRuntimeException();
}
} else {
collection.upsert(latestDocKey, latestConfigDocument);
collection.createOrReplace(latestDocKey, latestConfigDocument);
Copy link
Contributor

Choose a reason for hiding this comment

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

@suresh-prakash
This is the change i had made few months back and then reverted cause of issue in downstream doc store api .
It was fixed in hypertrace/document-store#207

but recently we revert this too (cause of issue in Iam service we saw recently) hypertrace/document-store#213

we would want to be sure on this

Choose a reason for hiding this comment

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

@harshit-kumar-v2 There is no issue with the createOrReplace API itself. The problem is only when we have a value that starts with a dollar. That case is not handled and we haven't faced a real use case for it. So, this change is safe.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's not safe because the values are provided by external users - same thing we discussed last time this went in and was reverted. So we need to revert this again until we can prioritize fixing doc store @suresh-prakash.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah didn't mean to pile on, just came across the already-existing comments on the revert PR! Any further discussion can be had there.

@bhubam bhubam merged commit ff9afcf into main Nov 21, 2024
9 checks passed
@bhubam bhubam deleted the use-new-dcoument-store-apis branch November 21, 2024 13:52
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.

5 participants