You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Deployment Revisited][Staging] Fix runtime errors on the job exporter cron (#4837)
### Motivation
The following error scenarios were not caught in unit tests:
* During export, blob for which there is a key, but no corresponding
object in the blobs bucket. This throws an Exception due to a 404 in the
GCS API call. To address this, the blob will not be uploaded during
export, and the key will be set to None during import
* During exports (and imports), data bundles that reference a non
existing bucket would result in a 404 from the GCS API, throwing a fatal
exception. To address this, the contents folder export will be skipped,
and the rsync will be skipped during import.
Also, there was no error treatment for RSync, so we do not know if the
operation was successful. The RSync methods were implementede to return
True on successful completion, and false on failure. If the operation
fails, an Exception is raised to force the cronjob to be retried.
### Carried over keys and project id
When serialized from a previous database, the Key entity will carry over
the GCP project name, which will result in the following exception
during the put call:
```
detail: "mismatched databases within request: <unknown!>~clusterfuzz-development vs. <unknown!>~cluster-fuzz"
, detail: "/Datastore.Commit to [2002:a05:6600:760b:b0:3ba:dcf:6bcb]:4001 : APP_ERROR(1) mismatched databases within request: <unknown!>~clusterfuzz-development vs. <unknown!>~cluster-fuzz"
]
```
For this reason, we cannot simply deserialize and put. The fields have
to be manually retrieved and assigned to the new entity, and the key
will be auto generated on every put. This was implemented by adding the
'_persist_entity' method.
### Other changes
The public method 'get_bucket' was added to the storage module, so we
can know if a GCS bucket already exists. This was already used
internally, it is now exposed in the storage interface.
### Testing strategy
Reusing the test suite already in place, and doing a manual
export/import from internal to chrome-development. The script finished
successfully in both scenarios, and the output looks sane in dev
0 commit comments