-
Notifications
You must be signed in to change notification settings - Fork 1.5k
pubsub: cannot clear bigquery subscription #8037
Copy link
Copy link
Closed
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important 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.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Metadata
Metadata
Assignees
Labels
api: pubsubIssues related to the Pub/Sub API.Issues related to the Pub/Sub API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.Important 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.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Type
Fields
Give feedbackNo fields configured for issues without a type.
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
Updatepasses on the emptyBigQueryConfiginstead of anilone along with the update mask.The flaw comes from
google-cloud-go/pubsub/subscription.go
Lines 849 to 850 in 372dd22
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 thetoProtomethod to convert a zero valued config tonil. To simplify, we only really need to check ifconfig.Tableis equal to the empty string, since we don't allow partial updates.I'm not sure if
PushConfigsuffers the same problem or not, but will investigate this separately.