Spanner updates#316
Open
toddlipcon wants to merge 7 commits into
Open
Conversation
GetDatabase returns codes.NotFound when the database doesn't exist, but createDatabase was treating any error as fatal and returning early, so the "database missing -> create it" path was unreachable. Check for NotFound explicitly and fall through to CreateDatabase in that case. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Pull the per-row spanner.Row -> map[string][]byte conversion out of queryRows so it can be reused by other read paths. Pure refactor, no behavior change. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add three new driver properties so the benchmark can target Spanner emulators or other non-public gRPC endpoints: spanner.endpoint custom gRPC endpoint (e.g. localhost:9010) spanner.insecure skip Google auth; use insecure gRPC creds spanner.experimental_host sets ClientConfig.IsExperimentalHost The credentials-file fallback is only consulted when spanner.insecure is false. The same options are plumbed into both the admin client and the data client, and NewClient is replaced with NewClientWithConfig so IsExperimentalHost can be set. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add BatchInsert, BatchUpdate, BatchDelete, and BatchRead so go-ycsb's batch path (batch.size > 1) actually batches operations into a single client.Apply / Query call. Previously only Insert/Update/Delete/Read were implemented, so the ycsb.BatchDB type assertion in DbWrapper failed and the framework silently fell back to one-row-per-RPC. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Expose Spanner's MaxCommitDelay commit option as a driver property. When unset, Spanner may server-side-amortize commits with a small delay, which hurts throughput on latency-bound benchmarks. Setting the property to 0 disables that amortization; any positive value sets an explicit upper bound in milliseconds. The value is plumbed through every client.Apply call via spanner.ApplyCommitOptions. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Allow point reads to go through the Spanner Read API (client.Single().ReadRow) instead of a parameterized SELECT. The Read API skips query parsing / planning on every call and measured meaningfully faster for workload C point lookups. The SQL path remains the default so existing setups behave identically. When spanner.use_read_api=true, we precompute the full column list once at Create() time (YCSB_KEY plus FIELD0..FIELDn-1 from fieldcount) so readallfields doesn't have to rebuild it per call. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi,
Here are a few various updates to the Spanner connector as I was playing around with it today. I'm happy to break these into separate PRs per feature, but I figured it may be easier just to send it as a single one since there are likely some conflicts depending which order the changes land in.