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

Change strict reading PG to only return rows when valid #2219

Merged
merged 1 commit into from
Jan 31, 2025

Conversation

josephschorr
Copy link
Member

This is necessary for the error and retry logic to work in the strict read proxy

@github-actions github-actions bot added area/datastore Affects the storage system area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools) labels Jan 30, 2025
@josephschorr josephschorr marked this pull request as ready for review January 30, 2025 19:41
@josephschorr josephschorr requested a review from a team as a code owner January 30, 2025 19:41
@josephschorr josephschorr marked this pull request as draft January 30, 2025 19:51
This is necessary for the error and retry logic to work in the strict read proxy
@josephschorr josephschorr marked this pull request as ready for review January 30, 2025 20:17
@josephschorr josephschorr marked this pull request as draft January 30, 2025 20:18
@@ -79,14 +79,14 @@ func TestReplicatedReaderReturnsExpectedError(t *testing.T) {
}

type fakeDatastore struct {
isPrimary bool
revision datastore.Revision
state string
Copy link
Contributor

Choose a reason for hiding this comment

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

why the change?

Copy link
Member Author

Choose a reason for hiding this comment

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

So I can have more test cases

require.NotEmpty(found)

// Perform a read at a manually constructed revision beyond head, which should fallback to the primary.
badRev := postgresRevision{
Copy link
Contributor

Choose a reason for hiding this comment

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

can you test the replica and make sure it does return error with this revision?

Copy link
Member Author

Choose a reason for hiding this comment

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

We do in the other test

@josephschorr josephschorr marked this pull request as ready for review January 31, 2025 16:11
@josephschorr josephschorr added this pull request to the merge queue Jan 31, 2025
Merged via the queue into authzed:main with commit 6db2a39 Jan 31, 2025
39 checks passed
@josephschorr josephschorr deleted the strict-read-first branch January 31, 2025 16:20
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/datastore Affects the storage system area/tooling Affects the dev or user toolchain (e.g. tests, ci, build tools)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants