From 6278a4d99b526dbd0ef0a44e013ea93e7c4c0788 Mon Sep 17 00:00:00 2001 From: Jeroen Vuerinckx <1046796+JeroenVu@users.noreply.github.com> Date: Mon, 25 Sep 2023 15:33:28 +0200 Subject: [PATCH 1/2] #1157: Fix for S3BlobStore bulk delete (without listeners) (failing since a133c446, test ignored since 855ed094) --- .../src/main/java/org/geowebcache/util/TMSKeyBuilder.java | 4 ++-- .../src/main/java/org/geowebcache/s3/S3BlobStore.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/geowebcache/core/src/main/java/org/geowebcache/util/TMSKeyBuilder.java b/geowebcache/core/src/main/java/org/geowebcache/util/TMSKeyBuilder.java index 4263d78e53..e8ac9b1eb6 100644 --- a/geowebcache/core/src/main/java/org/geowebcache/util/TMSKeyBuilder.java +++ b/geowebcache/core/src/main/java/org/geowebcache/util/TMSKeyBuilder.java @@ -194,7 +194,7 @@ public String parametersMetadataPrefix(final String layerName) { * @return the key prefix up to the coordinates (i.e. {@code * "////"}) */ - public String coordinatesPrefix(TileRange obj, boolean endWithSlah) { + public String coordinatesPrefix(TileRange obj, boolean endWithSlash) { checkNotNull(obj.getLayerName()); checkNotNull(obj.getGridSetId()); checkNotNull(obj.getMimeType()); @@ -215,7 +215,7 @@ public String coordinatesPrefix(TileRange obj, boolean endWithSlah) { } String shortFormat = mimeType.getFileExtension(); // png, png8, png24, etc - String key = join(endWithSlah, prefix, layer, gridset, shortFormat, parametersId); + String key = join(endWithSlash, prefix, layer, gridset, shortFormat, parametersId); return key; } diff --git a/geowebcache/s3storage/src/main/java/org/geowebcache/s3/S3BlobStore.java b/geowebcache/s3storage/src/main/java/org/geowebcache/s3/S3BlobStore.java index 4bc8c6076d..4c222ef70a 100644 --- a/geowebcache/s3storage/src/main/java/org/geowebcache/s3/S3BlobStore.java +++ b/geowebcache/s3storage/src/main/java/org/geowebcache/s3/S3BlobStore.java @@ -311,7 +311,7 @@ public KeyVersion apply(long[] loc) { @Override public boolean delete(final TileRange tileRange) throws StorageException { - final String coordsPrefix = keyBuilder.coordinatesPrefix(tileRange, false); + final String coordsPrefix = keyBuilder.coordinatesPrefix(tileRange, true); if (!s3Ops.prefixExists(coordsPrefix)) { return false; } From ae30cca9af00fc2671abfda7df8aead518af0e5c Mon Sep 17 00:00:00 2001 From: Jeroen Vuerinckx <1046796+JeroenVu@users.noreply.github.com> Date: Mon, 2 Oct 2023 14:24:16 +0200 Subject: [PATCH 2/2] #1157: Un-ignore test testTruncateOptimizationIfNoListeners --- .../org/geowebcache/s3/OfflineS3BlobStoreIntegrationTest.java | 1 - 1 file changed, 1 deletion(-) diff --git a/geowebcache/s3storage/src/test/java/org/geowebcache/s3/OfflineS3BlobStoreIntegrationTest.java b/geowebcache/s3storage/src/test/java/org/geowebcache/s3/OfflineS3BlobStoreIntegrationTest.java index 8b113c2c2a..8ec7f6bc22 100644 --- a/geowebcache/s3storage/src/test/java/org/geowebcache/s3/OfflineS3BlobStoreIntegrationTest.java +++ b/geowebcache/s3storage/src/test/java/org/geowebcache/s3/OfflineS3BlobStoreIntegrationTest.java @@ -52,7 +52,6 @@ protected S3BlobStoreInfo getConfiguration() { } @Override - @Ignore // randomly fails @Test public void testTruncateOptimizationIfNoListeners() throws StorageException, MimeException { super.testTruncateOptimizationIfNoListeners();