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: read time should be used for transaction reads #1171

Merged

Commits on Sep 7, 2023

  1. Allow datastore projectId to be fetched from clien

    Latency is caused by the call to getProjectId from Google auth. This change allows the project id to be retrieved if it is set in the client at creation time thereby reducing call latency.
    danieljbruce committed Sep 7, 2023
    Configuration menu
    Copy the full SHA
    b66827e View commit details
    Browse the repository at this point in the history

Commits on Sep 20, 2023

  1. Create a file for mocking out commits

    A test file is created where we mock out commit in the Gapic layer. The mock allows us to get the results passed to the commit endpoint in the Gapic layer.
    danieljbruce committed Sep 20, 2023
    Configuration menu
    Copy the full SHA
    684c469 View commit details
    Browse the repository at this point in the history

Commits on Sep 21, 2023

  1. Create a test to measure latency of call.

    To prove that the change works to reduce latency, a test is written. The test checks to see that the amount of time that passes between the time when the initial call is made in the user’s code and the time when the call reaches the gapic layer is sufficiently small. It will be a very small amount of time if the program does not need to do an auth lookup.
    danieljbruce committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    1ec6ed2 View commit details
    Browse the repository at this point in the history
  2. Run the linting fixes

    Run the linter so that spacing in the PR gets fixed for some of the lines of code.
    danieljbruce committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    40213ca View commit details
    Browse the repository at this point in the history
  3. Add license header to top of test file

    The license header needs to be added to the top of the new test file that is used for mocking out commit.
    danieljbruce committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    57e3b13 View commit details
    Browse the repository at this point in the history
  4. Add comment for test for now

    This is going to be a test for investigating the latency of the client.
    danieljbruce committed Sep 21, 2023
    Configuration menu
    Copy the full SHA
    af56d91 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2023

  1. Add a test for the mock server

    Measure the latency between the original call and the mock server.
    danieljbruce committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    72f9492 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    194e109 View commit details
    Browse the repository at this point in the history
  3. Add a log for call time

    Do check external to function after async call. Add log for call time.
    danieljbruce committed Sep 22, 2023
    Configuration menu
    Copy the full SHA
    22d5f54 View commit details
    Browse the repository at this point in the history

Commits on Sep 25, 2023

  1. Add another mock

    Other mock doesn’t require lazy client initialization.
    danieljbruce committed Sep 25, 2023
    Configuration menu
    Copy the full SHA
    81f5956 View commit details
    Browse the repository at this point in the history

Commits on Oct 13, 2023

  1. Eliminate code from the mock file

    Eliminate the fake datastore client because we need to do assertion checks that are specific to each test. This means there is no point in defining runQuery once in a mock because each test will mock it out differently.
    danieljbruce committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    dc9dbb7 View commit details
    Browse the repository at this point in the history
  2. Start off by adding read time to read options

    Add the code change that will add read time to read options for transactions.
    
    # Conflicts:
    #	test/transaction.ts
    danieljbruce committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    0ad0a57 View commit details
    Browse the repository at this point in the history
  3. Update the test to use transactions

    The idea is to test that read time got passed along for transactions specifically. This will be necessary for snapshot reads to work.
    danieljbruce committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    e795c3a View commit details
    Browse the repository at this point in the history
  4. Remove only

    Need the entire test suite to run
    danieljbruce committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    851877c View commit details
    Browse the repository at this point in the history
  5. Remove the before hook

    The before hook is not necessary. Just mock out the data client at the start.
    danieljbruce committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    b9bfd79 View commit details
    Browse the repository at this point in the history
  6. Remove unnecessary cherry picked files

    Files were cherry-picked that weren’t helpful for solving the problem. Remove them.
    danieljbruce committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    617b013 View commit details
    Browse the repository at this point in the history
  7. Clean up PR diff

    danieljbruce committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    4a32ad3 View commit details
    Browse the repository at this point in the history
  8. clean up PR diff

    danieljbruce committed Oct 13, 2023
    Configuration menu
    Copy the full SHA
    8f74353 View commit details
    Browse the repository at this point in the history

Commits on Oct 18, 2023

  1. Update the test so that it is run as a transaction

    Right now, providing a transaction id is necessary to run the request as a transaction.
    danieljbruce committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    4c9445c View commit details
    Browse the repository at this point in the history
  2. Add an integration test

    The integration test looks at the data from the snapshot read time for transactions and ensures that the read has no data thereby exercising the read time parameter.
    danieljbruce committed Oct 18, 2023
    Configuration menu
    Copy the full SHA
    32729e1 View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2023

  1. Merge branch 'main' of https://github.com/googleapis/nodejs-datastore

    …into not-use-read-time-for-run-tx
    
    # Conflicts:
    #	system-test/datastore.ts
    danieljbruce committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    6ef2800 View commit details
    Browse the repository at this point in the history
  2. Linting fixing indents

    Fix the indents in the system test folder
    danieljbruce committed Oct 30, 2023
    Configuration menu
    Copy the full SHA
    1354b47 View commit details
    Browse the repository at this point in the history

Commits on Apr 4, 2024

  1. Configuration menu
    Copy the full SHA
    80ca7ec View commit details
    Browse the repository at this point in the history
  2. Update the header

    danieljbruce committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    136f1b7 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    280244d View commit details
    Browse the repository at this point in the history
  4. Fix unit test

    beginTransaction needs to be mocked out now that a transaction will begin if runQuery is called.
    danieljbruce committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    95d0d54 View commit details
    Browse the repository at this point in the history
  5. System test changes.

    Add a sleep. Instead of changing the current test, add a new test because it means the reader of the PR can be sure that test coverage wasn’t reduced which is better.
    danieljbruce committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    aa4f125 View commit details
    Browse the repository at this point in the history
  6. Modify test

    Modify the test so that sleeps are long enough to create predictable results and tests actually check for the right values.
    danieljbruce committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    b78b091 View commit details
    Browse the repository at this point in the history
  7. Replace with less precise assert

    The test setup sometimes prepares before data with 0 entries and sometimes prepares before data with 1 entry so a less restrictive test is required in order for it to consistently pass.
    danieljbruce committed Apr 4, 2024
    Configuration menu
    Copy the full SHA
    cc72220 View commit details
    Browse the repository at this point in the history