Repository navigation
Commit fb73ed5
authored
fix(datastore): update emulator zip checksum for 2.3.1 (#14592)
Fixes #12058.
`LocalDatastoreHelper` still hands `e0d1170519cf52e2e5f9f93892cdf70c` to
`DownloadableEmulatorRunner`, and that is the checksum of the *2.0.2*
archive, not the 2.3.1 one it now points at. Found the culprit while
going through the file history: `e17b57b6` moved `MIN_VERSION` to 2.0.2
and set the checksum that matched, then `9eb86f06` (#1698) moved
`MIN_VERSION` on to 2.3.1 and didn't bring the checksum along. `curl -I`
on the old zip still reports `ETag: e0d1170519cf52e2e5f9f93892cdf70c`,
which is how I spotted it.
Since `downloadZipFile()` compares the two and re-fetches on mismatch,
the condition was true on every call and each `start()` pulled ~36 MB
again even with a perfectly good copy sitting in `java.io.tmpdir`.
Verified against the real artifact rather than just eyeballing the
string. The 2.3.1 zip is 37,929,131 bytes; downloading it and running
`md5sum` gives `7c1f5a3276241a8f78cb1a837daaaa47`, and GCS agrees
(`ETag` plus the `x-goog-hash` md5, base64 `fB9aMnYkGo94yxqDfaqqRw==`).
I also replayed the check from `BaseEmulatorHelper` over the downloaded
file: the old constant makes it re-download, the new one lets it use the
cached copy.
The second commit is a separate small thing I ran into in the same
constructor, so it's easy to drop if you'd rather keep this to one
change: the gcloud command line is built from the raw
`builder.consistency` while the downloadable runner's uses
`getConsistency()`. `newBuilder().build()` leaves `builder.consistency`
at 0.0 while `getConsistency()` resolves to `DEFAULT_CONSISTENCY` (0.9),
so the two runners disagree for the same helper. Using
`getConsistency()` in both makes them match.
---------
Co-authored-by: rootkiller6788 <rootkiller6788@users.noreply.github.com>1 parent 40b2b1a commit fb73ed5
1 file changed
Lines changed: 2 additions & 2 deletions
File tree
- java-datastore/google-cloud-datastore/src/main/java/com/google/cloud/datastore/testing
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
179 | | - | |
| 179 | + | |
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
| |||
0 commit comments