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

fix: Add version check in basicTxn.Query #2742

Merged

Conversation

fredcarle
Copy link
Collaborator

Relevant issue(s)

Resolves #2741

Description

This PR fixes a bug with the memory store where basicTxn.Query did not consider the transaction version when querying. This means that it could return KVs created after the transaction was initiated.

Note that the first commit documents the bug.

Tasks

  • I made sure the code is well commented, particularly hard-to-understand areas.
  • I made sure the repository-held documentation is changed accordingly.
  • I made sure the pull request title adheres to the conventional commit style (the subset used in the project can be found in tools/configs/chglog/config.yml).
  • I made sure to discuss its limitations such as threats to validity, vulnerability to mistake and misuse, robustness to invalidation of assumptions, resource requirements, ...

How has this been tested?

make test

Specify the platform(s) on which this was tested:

  • MacOS

@fredcarle fredcarle added bug Something isn't working area/datastore Related to the datastore / storage engine system labels Jun 20, 2024
@fredcarle fredcarle added this to the DefraDB v0.12 milestone Jun 20, 2024
@fredcarle fredcarle requested a review from a team June 20, 2024 03:33
@fredcarle fredcarle self-assigned this Jun 20, 2024
Copy link

codecov bot commented Jun 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 78.12%. Comparing base (e3eca29) to head (9891f2a).

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop    #2742      +/-   ##
===========================================
+ Coverage    78.08%   78.12%   +0.05%     
===========================================
  Files          311      311              
  Lines        23235    23238       +3     
===========================================
+ Hits         18141    18154      +13     
+ Misses        3706     3701       -5     
+ Partials      1388     1383       -5     
Flag Coverage Δ
all-tests 78.12% <100.00%> (+0.05%) ⬆️

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

Files Coverage Δ
datastore/memory/txn.go 98.79% <100.00%> (+0.02%) ⬆️

... and 6 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

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

Copy link
Member

@nasdf nasdf left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for tracking this down!

@fredcarle fredcarle merged commit c7fc43d into sourcenetwork:develop Jun 20, 2024
38 of 39 checks passed
@fredcarle fredcarle deleted the fredcarle/fix/memory-store-txn-query branch June 20, 2024 03:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/datastore Related to the datastore / storage engine system bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dsTxn.Query does not consider transaction when querying
2 participants