Skip to content

pubsub: cannot clear bigquery subscription #8037

@hongalex

Description

@hongalex

In the same vein as #7979, there is a flaw with the logic of clearing BigQuery subscriptions. Setting a zero valued BigQuery subscription is a signal to clear the bigquery subscription, but right now Update passes on the empty BigQueryConfig instead of a nil one along with the update mask.

The flaw comes from

if cfg.BigQueryConfig != nil {
psub.BigqueryConfig = cfg.BigQueryConfig.toProto()

If BigQueryConfig is not nil (in this case, the sentinel clearing value), we immediately try to convert into the proto struct as is, rather than transforming it as nil. The fix here is to update the toProto method to convert a zero valued config to nil. To simplify, we only really need to check if config.Table is equal to the empty string, since we don't allow partial updates.

I'm not sure if PushConfig suffers the same problem or not, but will investigate this separately.

Metadata

Metadata

Assignees

Labels

api: pubsubIssues related to the Pub/Sub API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions