You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by "chibenwa (via GitHub)" <gi...@apache.org> on 2024/12/02 22:09:32 UTC
[PR] [POC] Improve MinIO support [james-project]
chibenwa opened a new pull request, #2539:
URL: https://github.com/apache/james-project/pull/2539
Storing all blobs into a single bucket hurts: impossible to run the GC or do S3 administrative operations
(minio underlying model is mapping to OS folders, so Tmail storing all in one bucket litterally creates folders with dozens of millions of files which is a VERY bad idea)
First commit adds a little handy abstraction allowing alternative implems to GenerationAwareBlobId and makes the system more open: NICE.
The second commit could be done in Twake mail if needed though I do know some James users relying on MinIO in the wild out there...
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org
Re: [PR] [POC] Improve MinIO support [james-project]
Posted by "vttranlina (via GitHub)" <gi...@apache.org>.
vttranlina commented on PR #2539:
URL: https://github.com/apache/james-project/pull/2539#issuecomment-2513968272
> Just added the fixup for the quota-ratio, cause that's what the CI build is failing about
the quota is unrelated to Minio, we can remove it in this pr for avoid noise
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org
Re: [PR] [POC] Improve MinIO support [james-project]
Posted by "vttranlina (via GitHub)" <gi...@apache.org>.
vttranlina commented on code in PR #2539:
URL: https://github.com/apache/james-project/pull/2539#discussion_r1867358536
##########
server/container/guice/blob/deduplication-gc/src/main/java/org/apache/james/modules/blobstore/BlobDeduplicationGCModule.java:
##########
@@ -68,7 +70,14 @@ protected void configure() {
@Singleton
@Provides
public BlobId.Factory generationAwareBlobIdFactory(Clock clock, PlainBlobId.Factory delegate, GenerationAwareBlobId.Configuration configuration) {
- return new GenerationAwareBlobId.Factory(clock, delegate, configuration);
+ String property = System.getProperty("james.s3.minio.compatibility.mode");
Review Comment:
I see in the ticket
```
Have an option in blobstore.properties to actually switch to that MinIO compatibility mode:
```
Do you need it? I can adapt it
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org
Re: [PR] [POC] Improve MinIO support [james-project]
Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on PR #2539:
URL: https://github.com/apache/james-project/pull/2539#issuecomment-2514672452
Read https://github.com/apache/james-project/pull/2542 instead
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org
Re: [PR] [POC] Improve MinIO support [james-project]
Posted by "Arsnael (via GitHub)" <gi...@apache.org>.
Arsnael commented on PR #2539:
URL: https://github.com/apache/james-project/pull/2539#issuecomment-2513823565
Just added the fixup for the quota-ratio, cause that's what the CI build is failing about
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org
Re: [PR] [POC] Improve MinIO support [james-project]
Posted by "vttranlina (via GitHub)" <gi...@apache.org>.
vttranlina commented on code in PR #2539:
URL: https://github.com/apache/james-project/pull/2539#discussion_r1866972428
##########
server/blob/blob-storage-strategy/src/main/java/org/apache/james/server/blob/deduplication/MinIOGenerationAwareBlobId.java:
##########
@@ -0,0 +1,160 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.james.server.blob.deduplication;
+
+import static org.apache.james.server.blob.deduplication.GenerationAwareBlobId.NO_FAMILY;
+import static org.apache.james.server.blob.deduplication.GenerationAwareBlobId.computeGeneration;
+
+import java.time.Clock;
+import java.time.Instant;
+import java.util.Objects;
+
+import jakarta.inject.Inject;
+
+import org.apache.james.blob.api.BlobId;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Preconditions;
+
+public class MinIOGenerationAwareBlobId implements BlobId, GenerationAware {
+ public static class Factory implements BlobId.Factory {
+ public static final int NO_FAMILY = 0;
+ public static final int NO_GENERATION = 0;
+
+ private final Clock clock;
+ private final GenerationAwareBlobId.Configuration configuration;
+ private final BlobId.Factory delegate;
+
+ @Inject
+ public Factory(Clock clock, GenerationAwareBlobId.Configuration configuration, BlobId.Factory delegate) {
+ this.clock = clock;
+ this.configuration = configuration;
+ this.delegate = delegate;
+ }
+
+ @Override
+ public BlobId parse(String id) {
+ int separatorIndex1 = id.indexOf('/');
Review Comment:
An alternative approach is to use the "family" character to identify the blobId:
- family = 0 -> delegate
- family = 1 -> GenerationAwareBlobId
- family = 2 -> MinIOGenerationAwareBlobId.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org
Re: [PR] [POC] Improve MinIO support [james-project]
Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #2539:
URL: https://github.com/apache/james-project/pull/2539#discussion_r1867105101
##########
server/blob/blob-storage-strategy/src/main/java/org/apache/james/server/blob/deduplication/MinIOGenerationAwareBlobId.java:
##########
@@ -0,0 +1,160 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.james.server.blob.deduplication;
+
+import static org.apache.james.server.blob.deduplication.GenerationAwareBlobId.NO_FAMILY;
+import static org.apache.james.server.blob.deduplication.GenerationAwareBlobId.computeGeneration;
+
+import java.time.Clock;
+import java.time.Instant;
+import java.util.Objects;
+
+import jakarta.inject.Inject;
+
+import org.apache.james.blob.api.BlobId;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Preconditions;
+
+public class MinIOGenerationAwareBlobId implements BlobId, GenerationAware {
+ public static class Factory implements BlobId.Factory {
+ public static final int NO_FAMILY = 0;
+ public static final int NO_GENERATION = 0;
+
+ private final Clock clock;
+ private final GenerationAwareBlobId.Configuration configuration;
+ private final BlobId.Factory delegate;
+
+ @Inject
+ public Factory(Clock clock, GenerationAwareBlobId.Configuration configuration, BlobId.Factory delegate) {
+ this.clock = clock;
+ this.configuration = configuration;
+ this.delegate = delegate;
+ }
+
+ @Override
+ public BlobId parse(String id) {
+ int separatorIndex1 = id.indexOf('/');
+ if (separatorIndex1 == -1 || separatorIndex1 == id.length() - 1) {
+ return decorateWithoutGeneration(id);
Review Comment:
No not really.
With MinIO running GC on the screwed up generations held with all files in a single bucket is anyway a dead end. I prefer using plain blobIds for it.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org
Re: [PR] [POC] Improve MinIO support [james-project]
Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa commented on code in PR #2539:
URL: https://github.com/apache/james-project/pull/2539#discussion_r1867104028
##########
server/blob/blob-storage-strategy/src/main/java/org/apache/james/server/blob/deduplication/MinIOGenerationAwareBlobId.java:
##########
@@ -0,0 +1,160 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.james.server.blob.deduplication;
+
+import static org.apache.james.server.blob.deduplication.GenerationAwareBlobId.NO_FAMILY;
+import static org.apache.james.server.blob.deduplication.GenerationAwareBlobId.computeGeneration;
+
+import java.time.Clock;
+import java.time.Instant;
+import java.util.Objects;
+
+import jakarta.inject.Inject;
+
+import org.apache.james.blob.api.BlobId;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Preconditions;
+
+public class MinIOGenerationAwareBlobId implements BlobId, GenerationAware {
+ public static class Factory implements BlobId.Factory {
+ public static final int NO_FAMILY = 0;
+ public static final int NO_GENERATION = 0;
+
+ private final Clock clock;
+ private final GenerationAwareBlobId.Configuration configuration;
+ private final BlobId.Factory delegate;
+
+ @Inject
+ public Factory(Clock clock, GenerationAwareBlobId.Configuration configuration, BlobId.Factory delegate) {
+ this.clock = clock;
+ this.configuration = configuration;
+ this.delegate = delegate;
+ }
+
+ @Override
+ public BlobId parse(String id) {
+ int separatorIndex1 = id.indexOf('/');
Review Comment:
TBH less flexible: what if I already incremented several time the family?
Which value to use as a discriminant?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org
Re: [PR] [POC] Improve MinIO support [james-project]
Posted by "vttranlina (via GitHub)" <gi...@apache.org>.
vttranlina commented on code in PR #2539:
URL: https://github.com/apache/james-project/pull/2539#discussion_r1866984597
##########
server/blob/blob-storage-strategy/src/main/java/org/apache/james/server/blob/deduplication/MinIOGenerationAwareBlobId.java:
##########
@@ -0,0 +1,160 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one *
+ * or more contributor license agreements. See the NOTICE file *
+ * distributed with this work for additional information *
+ * regarding copyright ownership. The ASF licenses this file *
+ * to you under the Apache License, Version 2.0 (the *
+ * "License"); you may not use this file except in compliance *
+ * with the License. You may obtain a copy of the License at *
+ * *
+ * http://www.apache.org/licenses/LICENSE-2.0 *
+ * *
+ * Unless required by applicable law or agreed to in writing, *
+ * software distributed under the License is distributed on an *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY *
+ * KIND, either express or implied. See the License for the *
+ * specific language governing permissions and limitations *
+ * under the License. *
+ ****************************************************************/
+
+package org.apache.james.server.blob.deduplication;
+
+import static org.apache.james.server.blob.deduplication.GenerationAwareBlobId.NO_FAMILY;
+import static org.apache.james.server.blob.deduplication.GenerationAwareBlobId.computeGeneration;
+
+import java.time.Clock;
+import java.time.Instant;
+import java.util.Objects;
+
+import jakarta.inject.Inject;
+
+import org.apache.james.blob.api.BlobId;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.common.base.MoreObjects;
+import com.google.common.base.Preconditions;
+
+public class MinIOGenerationAwareBlobId implements BlobId, GenerationAware {
+ public static class Factory implements BlobId.Factory {
+ public static final int NO_FAMILY = 0;
+ public static final int NO_GENERATION = 0;
+
+ private final Clock clock;
+ private final GenerationAwareBlobId.Configuration configuration;
+ private final BlobId.Factory delegate;
+
+ @Inject
+ public Factory(Clock clock, GenerationAwareBlobId.Configuration configuration, BlobId.Factory delegate) {
+ this.clock = clock;
+ this.configuration = configuration;
+ this.delegate = delegate;
+ }
+
+ @Override
+ public BlobId parse(String id) {
+ int separatorIndex1 = id.indexOf('/');
+ if (separatorIndex1 == -1 || separatorIndex1 == id.length() - 1) {
+ return decorateWithoutGeneration(id);
Review Comment:
I understand this line aims to support compatibility,
but it should correctly be `GenerationAwareBlobId.Factory.parse(id)`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org
Re: [PR] [POC] Improve MinIO support [james-project]
Posted by "chibenwa (via GitHub)" <gi...@apache.org>.
chibenwa closed pull request #2539: [POC] Improve MinIO support
URL: https://github.com/apache/james-project/pull/2539
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org