Skip to content

Conversation

@talatuyarer
Copy link
Contributor

Rebased @byronellis's Original PR #2328 against latest main branch.

cc @flyrain

Checklist

  • 🛡️ Don't disclose security issues! (contact [email protected])
  • 🔗 Clearly explained why the changes are needed, or linked related issues: Fixes #
  • 🧪 Added/updated tests with good coverage, or manually tested (and explained how)
  • 💡 Added comments for complex logic
  • 🧾 Updated CHANGELOG.md (if needed)
  • 📚 Updated documentation in site/content/in-dev/unreleased (if needed)

@dimas-b
Copy link
Contributor

dimas-b commented Dec 12, 2025

@talatuyarer : Thanks for reviving Spanner Persistence! Do you intend to drive its implementation end-to-end (not just the first PR)?

@talatuyarer
Copy link
Contributor Author

Yes This is my plan @dimas-b

@dimas-b dimas-b changed the title Rebased Spanner Backend's Initial PR Spanner Persistence Backend for Polaris (Initial change) Dec 12, 2025
@dimas-b
Copy link
Contributor

dimas-b commented Dec 12, 2025

@talatuyarer : if you do not mind, please send an email to dev for awareness, since it's going to be a major new feature and people might have lost context (#2328 has been dormant since Sept)

@dimas-b
Copy link
Contributor

dimas-b commented Dec 12, 2025

@talatuyarer : Since this is a rebase of the work previously submitted in #2328, WDYT about adding @byronellis as a co-author on 0741431?

@talatuyarer talatuyarer force-pushed the spanner-backend-rebase branch from a175461 to 67a58c2 Compare December 12, 2025 19:24
@talatuyarer
Copy link
Contributor Author

@dimas-b Make sense. i did not know co author feature. I added him as co author on the commit now.

@byronellis
Copy link

Thanks for taking over Talat, sorry I haven't had a lot of time for it. FWIW here's the full implementation the first PR was based on. Looks like maybe a lot changed so not sure how relevant it is, but might be of some use:

https://github.com/byronellis/polaris/tree/spanner-persistence

@talatuyarer
Copy link
Contributor Author

Thanks for taking over Talat, sorry I haven't had a lot of time for it. FWIW here's the full implementation the first PR was based on. Looks like maybe a lot changed so not sure how relevant it is, but might be of some use:

https://github.com/byronellis/polaris/tree/spanner-persistence

Thank you @byronellis Let me take a look that.

Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

Just one concern about SchemaOptions (which was not affected by #2328), otherwise LGTM 👍

@talatuyarer talatuyarer requested a review from dimas-b December 12, 2025 20:24
Copy link
Contributor

@dimas-b dimas-b left a comment

Choose a reason for hiding this comment

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

I'll leave the PR open for a couple more days since the original PR had comments from other people. I wonder if they may want to review again.

@github-project-automation github-project-automation bot moved this from PRs In Progress to Ready to merge in Basic Kanban Board Dec 13, 2025
Copy link
Contributor

@flyrain flyrain left a comment

Choose a reason for hiding this comment

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

Thanks a lot for rebasing it, @talatuyarer ! This is a good start point for Spanner persistence. Given this PR is a rebased one and the general direction is fine, I think it's OK to merge it as is, or with minor changes. We need to fine issues or and fix forward.

errorprone = { module = "com.google.errorprone:error_prone_core", version = "2.45.0" }
google-cloud-iamcredentials = { module = "com.google.cloud:google-cloud-iamcredentials", version = "2.80.0" }
google-cloud-storage-bom = { module = "com.google.cloud:google-cloud-storage-bom", version = "2.60.0" }
google-cloud-libraries-bom = { module = "com.google.cloud:libraries-bom", version = "26.72.0" }
Copy link
Contributor

Choose a reason for hiding this comment

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

+1, thanks for the change, this makes the versions more consistent across Google Cloud components.

Continuing my review of #2328: a license update is still required. I’m fine with addressing this in a follow-up (see the earlier discussion here: #2328 (comment)).

Would it make sense to file a tracking issue and mark it as a 1.4 release blocker? That would help streamline the release manager’s workflow, since any outstanding license issue will cause a release RC to fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

SGTM! I can create a follow up PR after merging this.

@ConfigMapping(prefix = "polaris.persistence.spanner")
public interface GoogleCloudSpannerConfiguration {

public Optional<String> quotaProjectId();
Copy link
Contributor

@flyrain flyrain Dec 13, 2025

Choose a reason for hiding this comment

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

minor: all methods are public by default in an interface, no need to explicitly add a modifier.

Suggested change
public Optional<String> quotaProjectId();
Optional<String> quotaProjectId();

import org.slf4j.LoggerFactory;

@ApplicationScoped
public class GoogleCloudSpannerDatabaseClientLifecycleManager {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: Does it make sense to shorten the name a bit? I think SpannerClientLifecycleManager should be concise and descriptive enough here,

Suggested change
public class GoogleCloudSpannerDatabaseClientLifecycleManager {
public class SpannerClientLifecycleManager {

import java.util.Optional;

@ConfigMapping(prefix = "polaris.persistence.spanner")
public interface GoogleCloudSpannerConfiguration {
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: same naming suggestion here

Suggested change
public interface GoogleCloudSpannerConfiguration {
public interface SpannerConfiguration {

Copy link
Contributor

@singhpk234 singhpk234 left a comment

Choose a reason for hiding this comment

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

Thanks @talatuyarer for the contribution !

Comment on lines +40 to +41
`Properties` JSON,
InternalProperties JSON,
Copy link
Contributor

Choose a reason for hiding this comment

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

any reason we want JSON over JSONB seems like spanner supports it : https://docs.cloud.google.com/spanner/docs/working-with-jsonb

Choose a reason for hiding this comment

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

Spanner didn't support JSONB in Spanner mode (just PostgreSQL compatibility mode) when this was originally written. :-)

@@ -0,0 +1,86 @@
--
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need spanner to also follow v1 of pg / h2 ? since we not using relational-jdbc way of implementing stuff should we just add v3 schema of relational-jdbc here wdyt ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Following v3 schema of JDBC makes more sense to me, the Spanner impl. doesn't have to support the historical schemas.

Copy link
Contributor

Choose a reason for hiding this comment

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

Is Spanner schema related to JDBC schema in any way? Why should their respective version numbers be aligned?

Choose a reason for hiding this comment

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

Obviously inspired by, but no they're no real relation between the two (and has some Spanner-specific differences)

Copy link
Contributor

Choose a reason for hiding this comment

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

I think we should align the versions at least semantically. The schema directly dictates functionality. For example, without the new field in the entity table, the feature configuration ALLOW_TABLE_LOCATION_OVERLAP will not behave as expected. We should avoid a situation where a feature works with JDBC but fails with other persistence implementations due to schema drift.

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.

5 participants