事件驱动(Pub/sub)模式的 Google Storage Transfer Service 发生 NOT_FOUND 错误

问题描述 投票:0回答:1

我将 Google Storage Transfer Service 配置为将对象从 Google Cloud Storage 存储桶复制到另一个 Google Cloud Storage 存储桶。

顺便说一句,98%的对象复制成功,但2%的对象复制失败。 从错误详细信息中,我注意到失败的 2% 是 NOT_FOUND 错误,错误消息是

没有这样的对象:source-bucket-name/path/to/object/ObjectName.json

但是,如果我检查文件是否存在,它就存在。 我不明白为什么会发生这种情况,因为当对象创建成功时,GCS 会通知 Pubsub。 (对象完成)

有办法解决 NOT_FOUND 问题或任何解决方法吗?

这是我的配置连接器和存储传输设置。

---
apiVersion: storage.cnrm.cloud.google.com/v1beta1
kind: StorageNotification
metadata:
  name: source-notification
spec:
  bucketRef:
    name: source-bucket-name
  payloadFormat: JSON_API_V1
  topicRef:
    name: my-notification-topic
  eventTypes:
    - "OBJECT_FINALIZE"
    - "OBJECT_METADATA_UPDATE"
    - "OBJECT_DELETE"
    - "OBJECT_ARCHIVE"

---
apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
kind: PubSubTopic
metadata:
  name: my-notification-topic
spec:
  messageRetentionDuration: 2678400s # 31 days

---
apiVersion: pubsub.cnrm.cloud.google.com/v1beta1
kind: PubSubSubscription
metadata:
  name: my-notification-subscription
spec:
  ackDeadlineSeconds: 300
  enableExactlyOnceDelivery: false
  retainAckedMessages: false
  topicRef:
    name: my-notification-topic
  expirationPolicy:
    ttl: ""

由于 Config Connector 尚不支持事件驱动模式的 Google Storage Transfer,因此需要手动设置 Google Storage Transfer:

Scheduling mode: Event driven
Source
  Type: Google Cloud Storage
  Name: source-bucket-name
  Folder path: path/to/source
  Event stream:
    Pub/sub subscription name: projects/my-projects/subscriptions/my-notification-subscription
  Filters: None
Destination
  Type: Google Cloud Storage
  Name: destination-bucket-name
  Folder path: path/to/destination
Data handling options:
  Metadata options:
    ACL: Use destination bucket's object ACLs
    KMS key: Use destination bucket's encryption settings
    Storage class: Use destination bucket's storage class
    Temporary hold: Preserve object's original temporary hold status
    Time created: Do not preserve source object's time created
  When to overwrite: Always
  When to delete: Never

我想修复整个“NOT_FOUND”错误,或复制错误对象的解决方法。

google-cloud-platform google-cloud-pubsub data-transfer
1个回答
0
投票

我在转职方面也遇到过这样的问题。就我而言,我可以按如下方式重现该问题:

  • 创建从A桶到B桶的传输作业
  • 删除存储桶B
  • 创建B桶(同名)
  • 再次运行从 A 到 B 的传输 -> 这会产生许多 NOT_FOUND 错误

我的用例是创建备份,因此我可以通过不重复使用相同的存储桶名称作为备份传输的目标来解决该问题。

尽管如此,我还是写信给谷歌支持。他们可以在我上述说明的帮助下重现该问题。他们创建了修复程序并于 2024 年 7 月 3 日推出。我的问题已通过该推出得到解决。

© www.soinside.com 2019 - 2024. All rights reserved.