Skip to content

chore: deprecate experimentalHost and add instanceType support for Spanner Omni - #87

Merged
mayurkale22 merged 1 commit into
googleapis:mainfrom
sagnghos:spannerOmni
Jul 13, 2026
Merged

chore: deprecate experimentalHost and add instanceType support for Spanner Omni#87
mayurkale22 merged 1 commit into
googleapis:mainfrom
sagnghos:spannerOmni

Conversation

@sagnghos

Copy link
Copy Markdown
Contributor

This PR deprecates the ExperimentalHost option/flag and introduces the InstanceType configuration parameter supporting CLOUD and OMNI instances. This aligns the repository with modern Spanner architecture design patterns and improves backward-compatible fallback logic.

Key Changes

  1. Deprecated ExperimentalHost:
    • Marked ExperimentalHost as deprecated in both the client Options (options.go) and wrapper Options (spanner.go).
    • Warns users when using the deprecated --experimentalHost flag in the CLI launcher.
    • Automatically fallback-maps ExperimentalHost = true to InstanceType = OMNI and sets plain-text insecure transport credentials to preserve backward compatibility.
  2. Introduced InstanceType:
    • Added a new InstanceType string enum field with CLOUD (default) and OMNI options.
    • Renamed internal helper functions (createExperimentalHostCredentials -> createSpannerOmniCredentials) to reflect general Spanner Omni connectivity.
  3. Database URI Normalization:
    • Automatically prefixes simple database names with "projects/default/instances/default/databases/" when InstanceType == OMNI (or the deprecated ExperimentalHost == true).
  4. Enhanced Test Coverage:
    • Split existing test suites in both client options and wrapper clusters to test deprecated fallback behaviors and the new explicit InstanceType parameter independently.

How to Run/Test Against Spanner Omni

Running Integration Tests

To execute integration tests against a locally running Spanner Omni / emulator instance:

SPANNER_INSTANCE_TYPE=OMNI go test -v ./cassandra/gocql -tags=integration -args -target=spanner -spanner-endpoint=<omni-host>:<port>

Example (running against an instance at port 15000):

SPANNER_INSTANCE_TYPE=OMNI go test -v ./cassandra/gocql -tags=integration -args -target=spanner -spanner-endpoint=localhost:15000

Running the CLI Launcher

To launch the Cassandra-to-Spanner adapter proxy using the new instanceType parameter:

go run cassandra_launcher.go -db test-db -endpoint <omni-host>:<port> -instanceType OMNI -usePlainText -tcp ":9042" -grpc-channels 1

Example:

go run cassandra_launcher.go -db test-db -endpoint localhost:15000 -instanceType OMNI -usePlainText -tcp ":9042" -grpc-channels 1

Similar PRs for reference:

googleapis/google-cloud-go#14694
googleapis/java-spanner-cassandra#357

@mayurkale22
mayurkale22 merged commit 143a966 into googleapis:main Jul 13, 2026
9 checks passed
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.

2 participants