Bug: Flaky SimpleReadWriteTest.writeWithSchemaDisagreement/2 throws OOME
Status: Resolved
Priority: Normal
Resolution: Cannot Reproduce
Created: 12/Feb/21 18:30
Resolved: 14/Jan/22 00:10

The tests `writeWithSchemaDisagreement/2` occasionally throw OOME during CI. 
 * Circle: [https://app.circleci.com/pipelines/github/yifan-c/cassandra/207/workflows/9b97b04c-a086-4a3b-8abb-cbfd590eb0bf/jobs/1170]
 * Jenkins: [https://ci-cassandra.apache.org/view/patches/job/Cassandra-devbranch/379/testReport/junit/org.apache.cassandra.distributed.test/SimpleReadWriteTest/writeWithSchemaDisagreement2/]

Stack traces: 
{code:java}
java.lang.RuntimeException: java.lang.OutOfMemoryError: Java heap space
	at org.apache.cassandra.distributed.impl.Instance.lambda$startup$11(Instance.java:535)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.OutOfMemoryError: Java heap space
	at java.nio.HeapByteBuffer.<init>(HeapByteBuffer.java:57)
	at java.nio.ByteBuffer.allocate(ByteBuffer.java:335)
	at org.apache.cassandra.utils.memory.SlabAllocator.getRegion(SlabAllocator.java:139)
	at org.apache.cassandra.utils.memory.SlabAllocator.allocate(SlabAllocator.java:104)
	at org.apache.cassandra.utils.memory.ContextAllocator.allocate(ContextAllocator.java:57)
	at org.apache.cassandra.utils.memory.ContextAllocator.clone(ContextAllocator.java:47)
	at org.apache.cassandra.utils.memory.MemtableBufferAllocator.clone(MemtableBufferAllocator.java:40)
	at org.apache.cassandra.db.Memtable.put(Memtable.java:280)
	at org.apache.cassandra.db.ColumnFamilyStore.apply(ColumnFamilyStore.java:1314)
	at org.apache.cassandra.db.CassandraTableWriteHandler.write(CassandraTableWriteHandler.java:40)
	at org.apache.cassandra.db.Keyspace.applyInternal(Keyspace.java:661)
	at org.apache.cassandra.db.Keyspace.apply(Keyspace.java:513)
	at org.apache.cassandra.db.Mutation.apply(Mutation.java:215)
	at org.apache.cassandra.db.Mutation.apply(Mutation.java:220)
	at org.apache.cassandra.db.Mutation.apply(Mutation.java:229)
	at org.apache.cassandra.cql3.statements.ModificationStatement.executeInternalWithoutCondition(ModificationStatement.java:633)
	at org.apache.cassandra.cql3.statements.ModificationStatement.executeLocally(ModificationStatement.java:624)
	at org.apache.cassandra.cql3.QueryProcessor.executeOnceInternal(QueryProcessor.java:373)
	at org.apache.cassandra.schema.SchemaKeyspace.saveSystemKeyspacesSchema(SchemaKeyspace.java:332)
	at org.apache.cassandra.db.SystemKeyspace.finishStartup(SystemKeyspace.java:463)
	at org.apache.cassandra.distributed.impl.Instance.lambda$startup$11(Instance.java:515)
	at org.apache.cassandra.distributed.impl.Instance$$Lambda$25118/965087712.run(Unknown Source){code}
{code:java}
java.lang.OutOfMemoryError: GC overhead limit exceeded
	at java.util.Arrays.copyOf(Arrays.java:3332)
	at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:124)
	at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:448)
	at java.lang.StringBuilder.append(StringBuilder.java:136)
	at java.net.URLStreamHandler.parseURL(URLStreamHandler.java:255)
	at sun.net.www.protocol.file.Handler.parseURL(Handler.java:67)
	at java.net.URL.<init>(URL.java:640)
	at java.net.URL.<init>(URL.java:508)
	at sun.misc.URLClassPath$FileLoader.getResource(URLClassPath.java:1355)
	at sun.misc.URLClassPath.getResource(URLClassPath.java:249)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:363)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:362)
	at org.apache.cassandra.distributed.shared.InstanceClassLoader.loadClassInternal(InstanceClassLoader.java:101)
	at org.apache.cassandra.distributed.shared.InstanceClassLoader.loadClass(InstanceClassLoader.java:87)
	at ch.qos.logback.classic.util.ContextInitializer.configureByResource(ContextInitializer.java:73)
	at ch.qos.logback.classic.util.ContextInitializer.autoConfig(ContextInitializer.java:150)
	at org.slf4j.impl.StaticLoggerBinder.init(StaticLoggerBinder.java:84)
	at org.slf4j.impl.StaticLoggerBinder.<clinit>(StaticLoggerBinder.java:55)
	at org.slf4j.LoggerFactory.bind(LoggerFactory.java:150)
	at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:124)
	at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:412)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:357)
	at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:383)
	at org.apache.cassandra.utils.FBUtilities.<clinit>(FBUtilities.java:81)
	at org.apache.cassandra.distributed.impl.Instance.<init>(Instance.java:154)
	at org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper$$Lambda$25774/1714400529.apply(Unknown Source)
	at org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.newInstance(AbstractCluster.java:220)
	at org.apache.cassandra.distributed.impl.AbstractCluster$Wrapper.<init>(AbstractCluster.java:210)
	at org.apache.cassandra.distributed.Cluster.newInstanceWrapper(Cluster.java:43)
	at org.apache.cassandra.distributed.Cluster.newInstanceWrapper(Cluster.java:33)
{code}