Skip to content

fix(entity-query-service): revert bulk update #127

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

Closed
wants to merge 2 commits into from

Conversation

skjindal93
Copy link
Contributor

Bulk update APIs are currently leading to corrupt entity documents. Reverting it back, till we fix the root cause

Bulk update APIs are currently leading to corrupt entity documents. Reverting it back, till we fix the root cause
@skjindal93 skjindal93 requested a review from a team September 2, 2021 13:06
@codecov
Copy link

codecov bot commented Sep 2, 2021

Codecov Report

Merging #127 (130aa7f) into main (7305e9d) will decrease coverage by 0.09%.
The diff coverage is 75.00%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main     #127      +/-   ##
============================================
- Coverage     59.71%   59.61%   -0.10%     
+ Complexity      303      292      -11     
============================================
  Files            39       39              
  Lines          3043     2974      -69     
  Branches        376      368       -8     
============================================
- Hits           1817     1773      -44     
+ Misses         1053     1029      -24     
+ Partials        173      172       -1     
Flag Coverage Δ
integration 59.61% <75.00%> (-0.10%) ⬇️
unit 39.73% <75.00%> (-0.90%) ⬇️

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

Impacted Files Coverage Δ
...e/entity/query/service/EntityQueryServiceImpl.java 76.63% <75.00%> (-0.45%) ⬇️
...query/service/client/EntityQueryServiceClient.java 83.33% <0.00%> (+83.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7305e9d...130aa7f. Read the comment docs.

@github-actions
Copy link

github-actions bot commented Sep 2, 2021

Unit Test Results

  30 files   - 1    30 suites   - 1   23s ⏱️ -2s
137 tests  - 6  137 ✔️  - 6  0 💤 ±0  0 ❌ ±0 

Results for commit 130aa7f. ± Comparison against base commit 7305e9d.

Map<String, EntityUpdateInfo> entitiesMap = request.getEntitiesMap();
try {
doBulkUpdate(requestContext, entitiesMap);
responseObserver.onCompleted();
Copy link
Contributor

Choose a reason for hiding this comment

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

will try to look through this more carefully at some point today, but one thing that jumps out at me off the bat - we never actually onNext a result set chunk here that I can see.

Copy link
Contributor

Choose a reason for hiding this comment

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

Discussed a bit offline. There may not be a bug here, but it has a very unintuitive api that can easily lead to corruption - a Value going in looks like a oneof style object but is not, so both the field and type need to be set. If they're not both set, we may be changing data types of persisted data.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, the API isn't supposed to send any response, as of now. We can just change the API to just send an empty response as of now, instead of result set chunk

Copy link
Contributor

Choose a reason for hiding this comment

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

If we're going to break the new api by changing its return type anyway, perhaps it makes sense to fix the value type there?

@skjindal93
Copy link
Contributor Author

No need to revert the APIs. The API implementation is fine as tested by the integration tests #128. We need to enhance the entity query service to support updates for integer value types

@skjindal93 skjindal93 closed this Sep 2, 2021
@skjindal93 skjindal93 deleted the revert+eqs+bulk+update branch September 2, 2021 16:30
@aaron-steinfeld
Copy link
Contributor

No need to revert the APIs. The API implementation is fine as tested by the integration tests #128. We need to enhance the entity query service to support updates for integer value types

it should support that - wasn't the issue on the caller side?

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.

2 participants