Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

seqno parameter is ignored on transaction.run() requests #1940

@nickcampbell18

Description

@nickcampbell18

Environment details

  • OS: Linux
  • Node.js version: 20.2
  • npm version:
  • @google-cloud/spanner version: 6.9.0

Steps to reproduce

We were investigating whether it's possible to do parallel reads inside a read-write transaction, by sending a set of reads all with the same sequence number (we have since realised this is impossible, per the documentation: "A per-transaction sequence number used to identify this request. This field makes each request idempotent such that if the request is received multiple times, at most one will succeed.")

Anyway, the transaction.run() interface will ignore any given seqno parameter, e.g.:

transaction.run({query: "SELECT * FROM table", seqno: 42})
// But it uses the `transaction._seqno` property instead

Because of this code:

reqOpts = Object.assign(query, {
session: this.session.formattedName_!,
seqno: this._seqno++,
requestOptions: this.configureTagOptions(

It might be worth updating the types to make it clear that the user is unable to specify this - I wouldn't have spent 30 minutes scratching my head :)

Metadata

Metadata

Assignees

Labels

api: spannerIssues related to the googleapis/nodejs-spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions