Skip to content

Fix field matching in GCS visibility archival queries - #12507

Open
Garyouki wants to merge 1 commit into
temporalio:mainfrom
Garyouki:fix/gcs-visibility-field-filters
Open

Garyouki wants to merge 1 commit into
temporalio:mainfrom
Garyouki:fix/gcs-visibility-field-filters

Conversation

@Garyouki

Copy link
Copy Markdown

What changed?

Parse the basename of GCS visibility object keys and compare each requested hash with its exact filename field. Validate the extension and field count, and use the Run ID and Workflow Type preconditions for their respective query predicates.

Add regression coverage for cross-field matches, partial matches, object prefixes containing underscores, malformed filenames, and all three predicates through the visibility archiver's Query method.

Why?

A record with WorkflowType='target' and WorkflowId='other' could match WorkflowId='target' because the filter searched the entire object name. Run ID and Workflow Type predicates also used the Workflow ID filter.

Fixes #12506. This branch is based on main and is independent of the pagination fix in #12494.

How did you test it?

Before the fix, each of the three Query regression cases returned three records instead of the one matching the requested field.

  • built
  • run locally and tested manually
  • covered by existing tests
  • added new unit test(s)
  • added new functional test(s)

Passed:

  • go test -tags test_dep ./common/archiver/gcloud/... -count=1
  • make lint-code-fast GOLANGCI_LINT_BASE_REV=origin/main
  • git diff --check

Query tests use the real parser and filter predicates with a mocked storage connector; no live GCS validation was performed.

Potential risks

For nonempty filters, malformed object names are now excluded. The stored filename format and empty-filter behavior are unchanged.

@Garyouki
Garyouki requested a review from a team as a code owner October 10, 2026 17:10

This branch has not been deployed

No deployments
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.

GCS visibility archival filters match values in unrelated filename fields

1 participant