Skip to content

Commit 0d9cc50

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents c10ec5b + bf35c6e commit 0d9cc50

File tree

152 files changed

+4231
-2691
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

152 files changed

+4231
-2691
lines changed

.idea/compiler.xml

+3-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/ReleaseNotes.md

+23-2
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ Starting with version [3.4.455.0](#344550), the semantics of `UnnestedRecordType
1919
2020
* **Bug fix** Fix 1 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
2121
* **Bug fix** Fix 2 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
22-
* **Bug fix** Log total records scanned and time during index build [(Issue #2629)](https://github.com/FoundationDB/fdb-record-layer/issues/2629)
22+
* **Bug fix** Fix 3 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
2323
* **Bug fix** Fix 4 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
24-
* **Bug fix** Typobug: LUCENE_FILE_LOCK_TIME_WINDOW_MILLISECONDS has duplicated property key [(Issue #2632)](https://github.com/FoundationDB/fdb-record-layer/issues/2632)
24+
* **Bug fix** Fix 5 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
2525
* **Performance** Improvement 1 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
2626
* **Performance** Improvement 2 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
2727
* **Performance** Improvement 3 [(Issue #NNN)](https://github.com/FoundationDB/fdb-record-layer/issues/NNN)
@@ -41,6 +41,27 @@ Starting with version [3.4.455.0](#344550), the semantics of `UnnestedRecordType
4141
// end next release
4242
-->
4343

44+
### 3.4.489.0
45+
46+
* **Bug fix** Equality index scan can match additional suffix starting with zero byte [(Issue #2650)](https://github.com/FoundationDB/fdb-record-layer/issues/2650)
47+
* **Performance** Lucene: cleanup logs and lock release path [(Issue #2648)](https://github.com/FoundationDB/fdb-record-layer/issues/2648)
48+
49+
### 3.4.485.0
50+
51+
* **Bug fix** Improve logging for Lucene file locks [(Issue #2645)](https://github.com/FoundationDB/fdb-record-layer/issues/2645)
52+
* **Bug fix** Review Lucene's use of executors [(Issue #2638)](https://github.com/FoundationDB/fdb-record-layer/issues/2638)
53+
54+
### 3.4.484.0
55+
56+
* **Bug fix** AgilityContext: Prevent operations after failed commit [(Issue #2642)](https://github.com/FoundationDB/fdb-record-layer/issues/2642)
57+
* **Bug fix** LucenePartitioner.getNextNewerPartitionInfo() sometimes returns invalid (null) result [(Issue #2640)](https://github.com/FoundationDB/fdb-record-layer/issues/2640)
58+
59+
### 3.4.483.0
60+
61+
* **Bug fix** Log total records scanned and time during index build [(Issue #2629)](https://github.com/FoundationDB/fdb-record-layer/issues/2629)
62+
* **Bug fix** AgilityContext: prevent other threads writes after abort [(Issue #2634)](https://github.com/FoundationDB/fdb-record-layer/issues/2634)
63+
* **Bug fix** Typobug: LUCENE_FILE_LOCK_TIME_WINDOW_MILLISECONDS has duplicated property key [(Issue #2632)](https://github.com/FoundationDB/fdb-record-layer/issues/2632)
64+
4465
### 3.4.482.0
4566

4667
* **Bug fix** IndexingMerger: assume a write-only context by using a non synchronized runner [(Issue #2611)](https://github.com/FoundationDB/fdb-record-layer/issues/2611)

fdb-extensions/fdb-extensions.gradle

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ dependencies {
3535
testRuntimeOnly "org.junit.jupiter:junit-jupiter-engine:${junitVersion}"
3636
testRuntimeOnly "org.apache.logging.log4j:log4j-slf4j-impl:${log4jVersion}" // binding
3737
testImplementation "org.apache.logging.log4j:log4j-core:${log4jVersion}" // library
38+
testCompileOnly "com.google.auto.service:auto-service:undefined"
39+
testAnnotationProcessor "com.google.auto.service:auto-service:undefined"
3840
}
3941

4042
publishing {

fdb-extensions/src/test/java/com/apple/foundationdb/FDBTestBase.java

-47
This file was deleted.

fdb-extensions/src/test/java/com/apple/foundationdb/async/MoreAsyncUtilTest.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@
2020

2121
package com.apple.foundationdb.async;
2222

23+
import com.apple.foundationdb.test.TestExecutors;
2324
import org.junit.jupiter.api.Test;
2425

2526
import java.util.concurrent.CompletableFuture;
2627
import java.util.concurrent.Executor;
27-
import java.util.concurrent.ForkJoinPool;
2828
import java.util.concurrent.TimeUnit;
2929

3030
import static org.junit.jupiter.api.Assertions.assertEquals;
@@ -35,8 +35,7 @@
3535
* Tests for {@link MoreAsyncUtil}.
3636
*/
3737
public class MoreAsyncUtilTest {
38-
39-
static final Executor EXECUTOR = ForkJoinPool.commonPool();
38+
static final Executor EXECUTOR = TestExecutors.defaultThreadPool();
4039

4140
int count;
4241

fdb-extensions/src/test/java/com/apple/foundationdb/async/RangeSetTest.java

+14-8
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,21 @@
2121
package com.apple.foundationdb.async;
2222

2323
import com.apple.foundationdb.Database;
24-
import com.apple.foundationdb.FDB;
25-
import com.apple.foundationdb.FDBTestBase;
2624
import com.apple.foundationdb.KeyValue;
2725
import com.apple.foundationdb.Range;
2826
import com.apple.foundationdb.Transaction;
29-
import com.apple.foundationdb.directory.DirectoryLayer;
30-
import com.apple.foundationdb.directory.PathUtil;
3127
import com.apple.foundationdb.subspace.Subspace;
3228
import com.apple.foundationdb.test.MultipleTransactions;
29+
import com.apple.foundationdb.test.TestDatabaseExtension;
30+
import com.apple.foundationdb.test.TestSubspaceExtension;
3331
import com.apple.foundationdb.tuple.ByteArrayUtil;
3432
import com.apple.test.Tags;
3533
import org.junit.jupiter.api.BeforeEach;
3634
import org.junit.jupiter.api.Tag;
3735
import org.junit.jupiter.api.Test;
36+
import org.junit.jupiter.api.extension.RegisterExtension;
37+
import org.junit.jupiter.api.parallel.Execution;
38+
import org.junit.jupiter.api.parallel.ExecutionMode;
3839

3940
import javax.annotation.Nonnull;
4041
import java.util.ArrayList;
@@ -59,7 +60,12 @@
5960
* Tests for {@link RangeSet}.
6061
*/
6162
@Tag(Tags.RequiresFDB)
62-
public class RangeSetTest extends FDBTestBase {
63+
@Execution(ExecutionMode.CONCURRENT)
64+
public class RangeSetTest {
65+
@RegisterExtension
66+
static final TestDatabaseExtension dbExtension = new TestDatabaseExtension();
67+
@RegisterExtension
68+
TestSubspaceExtension rsSubspaceExtension = new TestSubspaceExtension(dbExtension);
6369
private Database db;
6470
private Subspace rsSubspace;
6571
private RangeSet rs;
@@ -113,9 +119,9 @@ private void checkIncreasing() {
113119
}
114120

115121
@BeforeEach
116-
void setUp() throws Exception {
117-
db = FDB.instance().open();
118-
rsSubspace = DirectoryLayer.getDefault().createOrOpen(db, PathUtil.from(getClass().getSimpleName())).get();
122+
void setUp() {
123+
db = dbExtension.getDatabase();
124+
rsSubspace = rsSubspaceExtension.getSubspace();
119125
rs = new RangeSet(rsSubspace);
120126
rs.clear(db).join();
121127
}

fdb-extensions/src/test/java/com/apple/foundationdb/async/RankedSetTest.java

+15-12
Original file line numberDiff line numberDiff line change
@@ -22,25 +22,27 @@
2222

2323
import com.apple.foundationdb.Database;
2424
import com.apple.foundationdb.FDB;
25-
import com.apple.foundationdb.FDBTestBase;
2625
import com.apple.foundationdb.NetworkOptions;
2726
import com.apple.foundationdb.Transaction;
2827
import com.apple.foundationdb.TransactionContext;
29-
import com.apple.foundationdb.directory.DirectoryLayer;
30-
import com.apple.foundationdb.directory.PathUtil;
3128
import com.apple.foundationdb.subspace.Subspace;
29+
import com.apple.foundationdb.test.TestDatabaseExtension;
30+
import com.apple.foundationdb.test.TestExecutors;
31+
import com.apple.foundationdb.test.TestSubspaceExtension;
3232
import com.apple.foundationdb.tuple.ByteArrayUtil;
3333
import com.apple.foundationdb.tuple.Tuple;
3434
import com.apple.test.Tags;
3535
import org.junit.jupiter.api.BeforeEach;
3636
import org.junit.jupiter.api.Tag;
3737
import org.junit.jupiter.api.Test;
38+
import org.junit.jupiter.api.extension.RegisterExtension;
39+
import org.junit.jupiter.api.parallel.Execution;
40+
import org.junit.jupiter.api.parallel.ExecutionMode;
3841

3942
import java.util.ArrayList;
4043
import java.util.Collections;
4144
import java.util.List;
4245
import java.util.concurrent.CompletionException;
43-
import java.util.concurrent.ForkJoinPool;
4446
import java.util.concurrent.ThreadLocalRandom;
4547

4648
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
@@ -54,7 +56,12 @@
5456
* Tests for {@link RankedSet}.
5557
*/
5658
@Tag(Tags.RequiresFDB)
57-
public class RankedSetTest extends FDBTestBase {
59+
@Execution(ExecutionMode.CONCURRENT)
60+
public class RankedSetTest {
61+
@RegisterExtension
62+
static final TestDatabaseExtension dbExtension = new TestDatabaseExtension();
63+
@RegisterExtension
64+
TestSubspaceExtension rsSubspaceExtension = new TestSubspaceExtension(dbExtension);
5865
private Database db;
5966
private Subspace rsSubspace;
6067

@@ -69,12 +76,8 @@ public void setUp() throws Exception {
6976
options.setTraceEnable("/tmp");
7077
options.setTraceLogGroup("RankedSetTest");
7178
}
72-
this.db = fdb.open();
73-
this.rsSubspace = DirectoryLayer.getDefault().createOrOpen(db, PathUtil.from(getClass().getSimpleName())).get();
74-
db.run(tr -> {
75-
tr.clear(rsSubspace.range());
76-
return null;
77-
});
79+
this.db = dbExtension.getDatabase();
80+
this.rsSubspace = rsSubspaceExtension.getSubspace();
7881
}
7982

8083
@Test
@@ -288,7 +291,7 @@ public void rankAsThoughPresent() {
288291
//
289292

290293
private RankedSet newRankedSet() {
291-
RankedSet result = new RankedSet(rsSubspace, ForkJoinPool.commonPool(), config);
294+
RankedSet result = new RankedSet(rsSubspace, TestExecutors.defaultThreadPool(), config);
292295
result.init(db).join();
293296
return result;
294297
}

fdb-extensions/src/test/java/com/apple/foundationdb/async/rtree/RTreeModificationTest.java

+20-40
Original file line numberDiff line numberDiff line change
@@ -21,24 +21,23 @@
2121
package com.apple.foundationdb.async.rtree;
2222

2323
import com.apple.foundationdb.Database;
24-
import com.apple.foundationdb.FDB;
25-
import com.apple.foundationdb.FDBTestBase;
2624
import com.apple.foundationdb.KeyValue;
27-
import com.apple.foundationdb.NetworkOptions;
2825
import com.apple.foundationdb.Range;
2926
import com.apple.foundationdb.async.AsyncUtil;
30-
import com.apple.foundationdb.directory.DirectoryLayer;
31-
import com.apple.foundationdb.directory.DirectorySubspace;
32-
import com.apple.foundationdb.directory.PathUtil;
3327
import com.apple.foundationdb.subspace.Subspace;
28+
import com.apple.foundationdb.test.TestDatabaseExtension;
29+
import com.apple.foundationdb.test.TestExecutors;
30+
import com.apple.foundationdb.test.TestSubspaceExtension;
3431
import com.apple.foundationdb.tuple.Tuple;
3532
import com.apple.test.Tags;
3633
import com.google.common.collect.ImmutableList;
37-
import org.junit.jupiter.api.AfterEach;
3834
import org.junit.jupiter.api.Assertions;
3935
import org.junit.jupiter.api.BeforeEach;
4036
import org.junit.jupiter.api.Tag;
4137
import org.junit.jupiter.api.Test;
38+
import org.junit.jupiter.api.extension.RegisterExtension;
39+
import org.junit.jupiter.api.parallel.Execution;
40+
import org.junit.jupiter.api.parallel.ExecutionMode;
4241
import org.junit.jupiter.params.ParameterizedTest;
4342
import org.junit.jupiter.params.provider.Arguments;
4443
import org.junit.jupiter.params.provider.MethodSource;
@@ -49,7 +48,6 @@
4948
import java.util.List;
5049
import java.util.Random;
5150
import java.util.concurrent.CompletableFuture;
52-
import java.util.concurrent.ForkJoinPool;
5351
import java.util.concurrent.atomic.AtomicLong;
5452
import java.util.stream.Stream;
5553

@@ -58,42 +56,24 @@
5856
*/
5957
@Tag(Tags.RequiresFDB)
6058
@Tag(Tags.Slow)
61-
public class RTreeModificationTest extends FDBTestBase {
59+
@Execution(ExecutionMode.CONCURRENT)
60+
public class RTreeModificationTest {
6261
private static final Logger logger = LoggerFactory.getLogger(RTreeModificationTest.class);
63-
6462
private static final int NUM_TEST_RUNS = 5;
6563
private static final int NUM_SAMPLES = 10_000;
6664

67-
private Database db;
68-
private DirectorySubspace rtSubspace;
69-
private DirectorySubspace rtSecondarySubspace;
65+
@RegisterExtension
66+
static final TestDatabaseExtension dbExtension = new TestDatabaseExtension();
67+
@RegisterExtension
68+
TestSubspaceExtension rtSubspace = new TestSubspaceExtension(dbExtension);
69+
@RegisterExtension
70+
TestSubspaceExtension rtSecondarySubspace = new TestSubspaceExtension(dbExtension);
7071

71-
private static final boolean TRACE = false;
72+
private Database db;
7273

7374
@BeforeEach
74-
public void setUpDb() throws Exception {
75-
FDB fdb = FDB.instance();
76-
if (TRACE) {
77-
NetworkOptions options = fdb.options();
78-
options.setTraceEnable("/tmp");
79-
options.setTraceLogGroup("RTreeTest");
80-
}
81-
db = fdb.open();
82-
rtSubspace = DirectoryLayer.getDefault().createOrOpen(db, PathUtil.from(RTree.class.getSimpleName())).get();
83-
db.run(tr -> {
84-
tr.clear(Range.startsWith(rtSubspace.getKey()));
85-
return null;
86-
});
87-
rtSecondarySubspace = DirectoryLayer.getDefault().createOrOpen(db, PathUtil.from(RTree.class.getSimpleName(), "secondary")).get();
88-
db.run(tr -> {
89-
tr.clear(Range.startsWith(rtSecondarySubspace.getKey()));
90-
return null;
91-
});
92-
}
93-
94-
@AfterEach
95-
public void closeDb() {
96-
db.close();
75+
public void setUpDb() {
76+
db = dbExtension.getDatabase();
9777
}
9878

9979
@ParameterizedTest
@@ -102,7 +82,7 @@ public void testAllDeleted(final RTree.Config config, final long seed, final int
10282
final RTreeScanTest.OnWriteCounters onWriteCounters = new RTreeScanTest.OnWriteCounters();
10383
final RTreeScanTest.OnReadCounters onReadCounters = new RTreeScanTest.OnReadCounters();
10484

105-
final RTree rTree = new RTree(rtSubspace, rtSecondarySubspace, ForkJoinPool.commonPool(), config,
85+
final RTree rTree = new RTree(rtSubspace.getSubspace(), rtSecondarySubspace.getSubspace(), TestExecutors.defaultThreadPool(), config,
10686
RTreeHilbertCurveHelpers::hilbertValue, NodeHelpers::newSequentialNodeId, onWriteCounters,
10787
onReadCounters);
10888
final long startTs = System.nanoTime();
@@ -160,7 +140,7 @@ public void testAllDeleted(final RTree.Config config, final long seed, final int
160140
@MethodSource("numSamplesAndNumDeletes")
161141
public void testRandomDeletes(@Nonnull final RTree.Config config, final long seed, final int numSamples, final int numDeletes) {
162142
final RTreeScanTest.OnReadCounters onReadCounters = new RTreeScanTest.OnReadCounters();
163-
final RTree rTree = new RTree(rtSubspace, rtSecondarySubspace, ForkJoinPool.commonPool(), config,
143+
final RTree rTree = new RTree(rtSubspace.getSubspace(), rtSecondarySubspace.getSubspace(), TestExecutors.defaultThreadPool(), config,
164144
RTreeHilbertCurveHelpers::hilbertValue, NodeHelpers::newSequentialNodeId, OnWriteListener.NOOP,
165145
onReadCounters);
166146
final Item[] items = randomInserts(db, rTree, seed, numSamples);
@@ -222,7 +202,7 @@ public <T extends Node> CompletableFuture<T> onAsyncRead(@Nonnull final Completa
222202
}
223203
};
224204

225-
final RTree rTree = new RTree(rtSubspace, rtSecondarySubspace, ForkJoinPool.commonPool(),
205+
final RTree rTree = new RTree(rtSubspace.getSubspace(), rtSecondarySubspace.getSubspace(), TestExecutors.defaultThreadPool(),
226206
new RTree.ConfigBuilder().build(),
227207
RTreeHilbertCurveHelpers::hilbertValue, NodeHelpers::newSequentialNodeId, OnWriteListener.NOOP,
228208
onReadListener);

0 commit comments

Comments
 (0)