Skip to content

Commit c52ecb1

Browse files
committed
Merge branch 'cassandra-5.0' into trunk
2 parents 2c684a0 + 2cd5515 commit c52ecb1

File tree

3 files changed

+72
-8
lines changed

3 files changed

+72
-8
lines changed

CHANGES.txt

+37
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,25 @@ Merged from 5.0:
8383
* Deprecate and ignore use_deterministic_table_id (CASSANDRA-19809)
8484
* Prioritize built indexes in IndexStatusManager (CASSANDRA-19400)
8585
* Add java.base/java.lang.reflect among opens for jvm11-client.options (CASSANDRA-19780)
86+
Merged from 4.1:
87+
Merged from 4.0:
88+
* Fix memory leak in BTree.FastBuilder (CASSANDRA-19785)
89+
* Fix millisecond and microsecond precision for commit log replay (CASSANDRA-19448)
90+
* Improve accuracy of memtable heap usage tracking (CASSANDRA-17298)
91+
* Fix rendering UNSET collection types in query tracing (CASSANDRA-19880)
92+
* Fix latency reported by ideal consistency level monitoring (CASSANDRA-19651)
93+
* Do not spam log with SSLExceptions (CASSANDRA-18839)
94+
95+
5.0.0
96+
5.0-rc2
97+
* Fix direct IO support always being evaluated to false upon the first start of a node (CASSANDRA-19779)
98+
* Memtable allocation type unslabbed_heap_buffers_logged will cause an assertion error for TrieMemtables and SegmentedTrieMemtables (CASSANDRA-19835)
99+
Merged from 4.0:
100+
* Use default commitlog settings in test YAMLs (CASSANDRA-19830)
101+
102+
103+
5.0-rc1
104+
>>>>>>> cassandra-5.0
86105
* Move bcpkix-jdk18on to build dependencies, update to 1.78 and explicitly enumerate transitive dependencies (CASSANDRA-19739)
87106
* Avoid streams in the common case for UpdateTransaction creation (CASSANDRA-19675)
88107
* Only wait until native_transport_timeout for dispatcher to finish (CASSANDRA-19697)
@@ -131,6 +150,24 @@ Merged from 4.1:
131150
* Refresh stale paxos commit (CASSANDRA-19617)
132151
* Reduce info logging from automatic paxos repair (CASSANDRA-19445)
133152
* Support legacy plain_text_auth section in credentials file removed unintentionally (CASSANDRA-19498)
153+
Merged from 4.0:
154+
* Fix millisecond and microsecond precision for commit log replay (CASSANDRA-19448)
155+
* Improve accuracy of memtable heap usage tracking (CASSANDRA-17298)
156+
* Fix rendering UNSET collection types in query tracing (CASSANDRA-19880)
157+
* Fix latency reported by ideal consistency level monitoring (CASSANDRA-19651)
158+
* Use default commitlog settings in test YAMLs (CASSANDRA-19830)
159+
* Do not spam log with SSLExceptions (CASSANDRA-18839)
160+
* Fix schema.cql created by a snapshot after dropping more than one column (CASSANDRA-19747)
161+
* UnsupportedOperationException when reducing scope for LCS compactions (CASSANDRA-19704)
162+
* Make LWT conditions behavior on frozen and non-frozen columns consistent for null column values (CASSANDRA-19637)
163+
* Add timeout specifically for bootstrapping nodes (CASSANDRA-15439)
164+
* Bring Redhat packge dirs/ownership/perms in line with Debian package (CASSANDRA-19565)
165+
Merged from 3.0:
166+
* Upgrade OWASP to 10.0.0 (CASSANDRA-19738)
167+
168+
169+
4.1.5
170+
>>>>>>> cassandra-4.1
134171
* Make queries visible to the "system_views.queries" virtual table at the coordinator level (CASSANDRA-19577)
135172
* Fix hints delivery for a node going down repeatedly (CASSANDRA-19495)
136173
* Do not go to disk for reading hints file sizes (CASSANDRA-19477)

src/java/org/apache/cassandra/utils/btree/BTree.java

+32-8
Original file line numberDiff line numberDiff line change
@@ -3317,28 +3317,52 @@ public Object[] buildReverse()
33173317
public void close()
33183318
{
33193319
reset();
3320-
pool.offer(this);
3321-
pool = null;
3320+
if (pool != null)
3321+
{
3322+
pool.offer(this);
3323+
pool = null;
3324+
}
33223325
}
33233326

33243327
@Override
33253328
void reset()
33263329
{
3327-
// we clear precisely to leaf().count and branch.count because, in the case of a builder,
3328-
// if we ever fill the buffer we will consume it entirely for the tree we are building
3329-
// so the last count should match the number of non-null entries
3330-
Arrays.fill(leaf().buffer, 0, leaf().count, null);
3330+
Arrays.fill(leaf().buffer, null);
33313331
leaf().count = 0;
33323332
BranchBuilder branch = leaf().parent;
33333333
while (branch != null && branch.inUse)
33343334
{
3335-
Arrays.fill(branch.buffer, 0, branch.count, null);
3336-
Arrays.fill(branch.buffer, MAX_KEYS, MAX_KEYS + 1 + branch.count, null);
3335+
Arrays.fill(branch.buffer, null);
33373336
branch.count = 0;
33383337
branch.inUse = false;
33393338
branch = branch.parent;
33403339
}
33413340
}
3341+
3342+
public boolean validateEmpty()
3343+
{
3344+
LeafOrBranchBuilder cur = leaf();
3345+
boolean hasOnlyNulls = true;
3346+
while (hasOnlyNulls && cur != null)
3347+
{
3348+
hasOnlyNulls = hasOnlyNulls(cur.buffer) && hasOnlyNulls(cur.savedBuffer) && cur.savedNextKey == null;
3349+
cur = cur.parent;
3350+
}
3351+
return hasOnlyNulls;
3352+
}
3353+
3354+
private static boolean hasOnlyNulls(Object[] buffer)
3355+
{
3356+
if (buffer == null)
3357+
return true;
3358+
3359+
for (int i = 0 ; i < buffer.length ; ++i)
3360+
{
3361+
if (buffer[i] != null)
3362+
return false;
3363+
}
3364+
return true;
3365+
}
33423366
}
33433367

33443368
private static abstract class AbstractUpdater extends AbstractFastBuilder implements AutoCloseable

test/burn/org/apache/cassandra/utils/LongBTreeTest.java

+3
Original file line numberDiff line numberDiff line change
@@ -730,6 +730,9 @@ public void testFastBuilder()
730730
Object[] btree = builder.build();
731731
assertEquals(i + 1, BTree.size(btree));
732732
assertTrue(""+i, BTree.<Integer>isWellFormed(btree, naturalOrder()));
733+
assertTrue(""+i, BTree.<Integer>isWellFormed(btree, naturalOrder()));
734+
builder.close();
735+
assertTrue(builder.validateEmpty());
733736
}
734737
}
735738
}

0 commit comments

Comments
 (0)