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

Add in process postgres duchy correctness tests #1152

Merged
merged 9 commits into from
Aug 9, 2023

Conversation

YuhongWang-Amazon
Copy link
Contributor

This adds in process postgres duchy correctness tests

@wfa-reviewable
Copy link

This change is Reviewable

Copy link
Contributor

@renjiezh renjiezh left a comment

Choose a reason for hiding this comment

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

Reviewed 22 of 26 files at r1, 5 of 5 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @YuhongWang-Amazon)

Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewed 16 of 26 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @YuhongWang-Amazon)


src/main/kotlin/org/wfanet/measurement/duchy/deploy/common/service/BUILD.bazel line 33 at r2 (raw file):

)

kt_jvm_library(

If it's under deploy/common, it implies it's not specific to a given cloud. Anything specific to gcloud (e.g. Spanner) would go under deploy/gcloud.

As an aside, I've never been a fan of the "data services" interface and figure anything that needs a specific implementation of a service can call its constructor. That said, it's totally fine to keep it.

Copy link
Contributor Author

@YuhongWang-Amazon YuhongWang-Amazon left a comment

Choose a reason for hiding this comment

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

Reviewable status: 23 of 28 files reviewed, 1 unresolved discussion (waiting on @renjiezh and @SanjayVas)


src/main/kotlin/org/wfanet/measurement/duchy/deploy/common/service/BUILD.bazel line 33 at r2 (raw file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

If it's under deploy/common, it implies it's not specific to a given cloud. Anything specific to gcloud (e.g. Spanner) would go under deploy/gcloud.

As an aside, I've never been a fan of the "data services" interface and figure anything that needs a specific implementation of a service can call its constructor. That said, it's totally fine to keep it.

Done.

Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewed 5 of 26 files at r1, 4 of 5 files at r2, 5 of 5 files at r3, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @YuhongWang-Amazon)


src/test/kotlin/org/wfanet/measurement/integration/postgres/V2PostgresInProcessLifeOfAReportIntegrationTest.kt line 37 at r3 (raw file):

/** Implementation of [InProcessLifeOfAReportIntegrationTest] for Postgres. */
class V2PostgresInProcessLifeOfAReportIntegrationTest : InProcessLifeOfAReportIntegrationTest() {

What's the V2 about, btw?

Code quote:

V2

Copy link
Contributor Author

@YuhongWang-Amazon YuhongWang-Amazon left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @YuhongWang-Amazon)


src/test/kotlin/org/wfanet/measurement/integration/postgres/V2PostgresInProcessLifeOfAReportIntegrationTest.kt line 37 at r3 (raw file):

Previously, YuhongWang-Amazon wrote…

I think it means to test the v2 reporting service: https://github.com/world-federation-of-advertisers/cross-media-measurement/tree/main/src/main/kotlin/org/wfanet/measurement/reporting/deploy/v2

Sorry, I knew that. I misread this as being a Duchy test.

@YuhongWang-Amazon YuhongWang-Amazon enabled auto-merge (squash) August 9, 2023 17:54
@YuhongWang-Amazon YuhongWang-Amazon merged commit a26e5d4 into main Aug 9, 2023
@YuhongWang-Amazon YuhongWang-Amazon deleted the yuhong.duchy-inprocess-correctness-test branch August 9, 2023 18:14
Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion


src/test/kotlin/org/wfanet/measurement/integration/gcloud/GCloudPostgresInProcessLifeOfAMeasurementIntegrationTest.kt line 29 at r3 (raw file):

/**
 * Implementation of [InProcessLifeOfAMeasurementIntegrationTest] for GCloud backends with Postgres

Sorry I had missed this before. The naming and comment are inaccurate since the Kingdom still uses Spanner here. Only the Duchies were swapped to Postgres.

Code quote:

GCloud backends with Postgres

src/test/kotlin/org/wfanet/measurement/integration/postgres/V2PostgresInProcessLifeOfAReportIntegrationTest.kt line 46 at r3 (raw file):

    ProviderRule<
      (String, ComputationLogEntriesCoroutineStub) -> InProcessDuchy.DuchyDependencies
    > by lazy { PostgresDuchyDependencyProviderRule(ALL_DUCHY_NAMES) }

@tristanvuong2021 reported that this change made the test significantly slower.

Copy link
Contributor Author

@YuhongWang-Amazon YuhongWang-Amazon left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion


src/test/kotlin/org/wfanet/measurement/integration/gcloud/GCloudPostgresInProcessLifeOfAMeasurementIntegrationTest.kt line 29 at r3 (raw file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

Sorry I had missed this before. The naming and comment are inaccurate since the Kingdom still uses Spanner here. Only the Duchies were swapped to Postgres.

Any suggestions for the class name? I can update the comment to point out the kingdom is still spanner.


src/test/kotlin/org/wfanet/measurement/integration/postgres/V2PostgresInProcessLifeOfAReportIntegrationTest.kt line 46 at r3 (raw file):

Previously, SanjayVas (Sanjay Vasandani) wrote…

@tristanvuong2021 reported that this change made the test significantly slower.

The Postgres Version of the lifeOfmeasurementTest is also slower than the spanner version. My guess is that in process postgres is slow?
I can update this the reporting integration test to use spanner duchy if needed.

Copy link
Contributor Author

@YuhongWang-Amazon YuhongWang-Amazon left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion


src/test/kotlin/org/wfanet/measurement/integration/postgres/V2PostgresInProcessLifeOfAReportIntegrationTest.kt line 46 at r3 (raw file):

Previously, YuhongWang-Amazon wrote…

The Postgres Version of the lifeOfmeasurementTest is also slower than the spanner version. My guess is that in process postgres is slow?
I can update this the reporting integration test to use spanner duchy if needed.

Did some tests locally, when using postgres duchy, the tests took 196s. when using spanner duchy, the tests took 110s.
@tristanvuong2021 does the above numbers match with the original performance?

Copy link
Member

@SanjayVas SanjayVas left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion


src/test/kotlin/org/wfanet/measurement/integration/gcloud/GCloudPostgresInProcessLifeOfAMeasurementIntegrationTest.kt line 29 at r3 (raw file):

Previously, YuhongWang-Amazon wrote…

Any suggestions for the class name? I can update the comment to point out the kingdom is still spanner.

I'm thinking instead of having a different class name and a different test, perhaps just go back to a single test but replace one of the Duchies with a Postgres implementation.


src/test/kotlin/org/wfanet/measurement/integration/postgres/V2PostgresInProcessLifeOfAReportIntegrationTest.kt line 46 at r3 (raw file):

Previously, YuhongWang-Amazon wrote…

Did some tests locally, when using postgres duchy, the tests took 196s. when using spanner duchy, the tests took 110s.
@tristanvuong2021 does the above numbers match with the original performance?

We know for sure that the embedded postgres implementation we use for testing has more overhead due to being a full Postgres instance running in a Docker container, as opposed to the lightweight in-memory emulator we have for Spanner. I'm not sure what the differences are in performance of the two once actually started up.

Regardless, I don't think we actually need to have made any changes here. It can just be reverted back to using the Spanner Duchy implementation for the time being.

ple13 pushed a commit that referenced this pull request Aug 16, 2024
This adds in process postgres duchy correctness tests
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.

4 participants