This is an automated email from the ASF dual-hosted git repository. btellier pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/james-project.git
commit 0a136080d09c3d2a207a1a0d6840620400fde0b6 Author: Gautier DI FOLCO <[email protected]> AuthorDate: Wed Mar 18 16:35:21 2020 +0100 JAMES-3121 Disable read_repair for Cassandra time serie tables (EnqueuedMail and DeletedMail) According to https://stackoverflow.com/a/43676007 > Recommendations: if the table is for time series data, it can be set to 0 (zero). > For other tables, the more performant strategy is to set dc_local_read_repair_chance to 0.1 > > Source : http://docs.datastax.com/en/cql/3.1/cql/cql_reference/tabProp.html#tabProp__cql_tabprop_more_read_repairs --- .../rabbitmq/view/cassandra/CassandraMailQueueViewModule.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/CassandraMailQueueViewModule.java b/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/CassandraMailQueueViewModule.java index cfade20..518fe3b 100644 --- a/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/CassandraMailQueueViewModule.java +++ b/server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/CassandraMailQueueViewModule.java @@ -37,6 +37,8 @@ import com.datastax.driver.core.schemabuilder.SchemaBuilder; public interface CassandraMailQueueViewModule { + Double NO_READ_REPAIR = 0.0; + interface EnqueuedMailsTable { String TABLE_NAME = "enqueuedMailsV3"; @@ -89,7 +91,8 @@ public interface CassandraMailQueueViewModule { .options(options -> options .compactionOptions(SchemaBuilder.timeWindowCompactionStrategy() .compactionWindowSize(1) - .compactionWindowUnit(HOURS))) + .compactionWindowUnit(HOURS)) + .readRepairChance(NO_READ_REPAIR)) .statement(statement -> statement .addPartitionKey(EnqueuedMailsTable.QUEUE_NAME, text()) .addPartitionKey(EnqueuedMailsTable.TIME_RANGE_START, timestamp()) @@ -122,7 +125,8 @@ public interface CassandraMailQueueViewModule { + DeletedMailTable.TABLE_NAME + " we need to filter out mails have been dequeued by checking their " + "existence in this table") .options(options -> options - .compactionOptions(SchemaBuilder.timeWindowCompactionStrategy())) + .compactionOptions(SchemaBuilder.timeWindowCompactionStrategy()) + .readRepairChance(NO_READ_REPAIR)) .statement(statement -> statement .addPartitionKey(DeletedMailTable.QUEUE_NAME, text()) .addPartitionKey(DeletedMailTable.ENQUEUE_ID, uuid())) --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
