Enable and test purging

This commit is contained in:
Benedict Elliott Smith 2024-10-10 12:28:48 +01:00 committed by David Capwell
parent aa6ebc140f
commit 25b1bd74b8
5 changed files with 20 additions and 10 deletions

@ -1 +1 @@
Subproject commit 8bce46bee7497262a8c16c6b779c08558968604f
Subproject commit 8f11c206ca178dffbe67a4b3d7e23288e9545d3a

View File

@ -67,6 +67,7 @@ public class AccordSpec
public volatile DurationSpec.IntSecondsBound fast_path_update_delay = new DurationSpec.IntSecondsBound(5);
public volatile DurationSpec.IntSecondsBound gc_delay = new DurationSpec.IntSecondsBound(300);
public volatile DurationSpec.IntSecondsBound schedule_durability_frequency = new DurationSpec.IntSecondsBound(120);
public volatile DurationSpec.IntSecondsBound durability_txnid_lag = new DurationSpec.IntSecondsBound(10);
public volatile DurationSpec.IntSecondsBound shard_durability_cycle = new DurationSpec.IntSecondsBound(5, TimeUnit.MINUTES);

View File

@ -5338,6 +5338,11 @@ public class DatabaseDescriptor
conf.accord.fast_path_update_delay = new DurationSpec.IntSecondsBound(seconds);
}
public static long getAccordGCDelay(TimeUnit unit)
{
return conf.accord.gc_delay.to(unit);
}
public static long getAccordScheduleDurabilityFrequency(TimeUnit unit)
{
return conf.accord.schedule_durability_frequency.to(unit);

View File

@ -34,6 +34,7 @@ import accord.utils.async.AsyncResult;
import accord.utils.async.AsyncResults;
import org.agrona.collections.Object2ObjectHashMap;
import org.apache.cassandra.concurrent.ScheduledExecutors;
import org.apache.cassandra.config.DatabaseDescriptor;
import org.apache.cassandra.db.ColumnFamilyStore;
import org.apache.cassandra.db.DataRange;
import org.apache.cassandra.db.Keyspace;
@ -91,7 +92,8 @@ public class AccordDataStore implements DataStore
ColumnFamilyStore cfs = Keyspace.openAndGetStoreIfExists(tableMetadata);
// TODO (required): when we can safely map TxnId.hlc() -> local timestamp, consult Memtable timestamps
e.getValue().position = cfs.getCurrentMemtable().getCommitLogLowerBound();
Memtable memtable = cfs.getCurrentMemtable();
e.getValue().position = memtable.getCommitLogLowerBound();
}
ScheduledExecutors.scheduledTasks.schedule(() -> {
@ -118,7 +120,7 @@ public class AccordDataStore implements DataStore
else
result.setSuccess(null);
});
}, 5L, TimeUnit.MINUTES);
}, DatabaseDescriptor.getAccordGCDelay(TimeUnit.MILLISECONDS), TimeUnit.MILLISECONDS);
return result;
}

View File

@ -64,8 +64,10 @@ public class AccordLoadTest extends AccordTestBase
public static void setUp() throws IOException
{
CassandraRelevantProperties.SIMULATOR_STARTED.setString(Long.toString(MILLISECONDS.toSeconds(currentTimeMillis())));
AccordTestBase.setupCluster(builder -> builder, 3);
// AccordTestBase.setupCluster(builder -> builder.withConfig(config -> config.with(Feature.values())), 3);
// AccordTestBase.setupCluster(builder -> builder, 3);
AccordTestBase.setupCluster(builder -> builder.withConfig(config -> config
.set("accord.schedule_durability_frequency", "5s")
.set("accord.gc_delay", "5s")), 3);
}
@Ignore
@ -92,11 +94,11 @@ public class AccordLoadTest extends AccordTestBase
ICoordinator coordinator = cluster.coordinator(1);
final int repairInterval = Integer.MAX_VALUE;
// final int repairInterval = 3000;
final int compactionInterval = Integer.MAX_VALUE;
// final int compactionInterval = 3000;
final int flushInterval = Integer.MAX_VALUE;
// final int flushInterval = 1000;
final int compactionPeriodSeconds = -1;
// final int compactionInterval = Integer.MAX_VALUE;
final int compactionInterval = 3000;
// final int flushInterval = Integer.MAX_VALUE;
final int flushInterval = 1000;
final int compactionPeriodSeconds = 1;
final int restartInterval = 150_000_000;
final int batchSizeLimit = 1000;
final long batchTime = TimeUnit.SECONDS.toNanos(10);