Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue 6683: LTS - Fix thread visibility issues #6687

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -1166,10 +1166,10 @@ private CompletableFuture<SystemSnapshotRecord> createSystemSnapshotRecord(Metad
val systemSnapshot = SystemSnapshotRecord.builder()
.epoch(epoch)
.fileIndex(currentFileIndex.get())
.segmentSnapshotRecords(new ArrayList<>())
.segmentSnapshotRecords(Collections.synchronizedList(new ArrayList<>()))
.build();

val futures = Collections.synchronizedList(new ArrayList<CompletableFuture<Void>>());
val futures = new ArrayList<CompletableFuture<Void>>();
for (val systemSegment : systemSegments) {
// Find segment metadata.
val future = txn.get(systemSegment)
Expand All @@ -1179,7 +1179,7 @@ private CompletableFuture<SystemSnapshotRecord> createSystemSnapshotRecord(Metad

val segmentSnapshot = SegmentSnapshotRecord.builder()
.segmentMetadata(segmentMetadata)
.chunkMetadataCollection(new ArrayList<>())
.chunkMetadataCollection(Collections.synchronizedList(new ArrayList<>()))
.build();

// Enumerate all chunks.
Expand Down Expand Up @@ -1452,7 +1452,7 @@ protected void declareVersions() {
}

private void read00(RevisionDataInput input, SystemJournalRecordBatchBuilder b) throws IOException {
b.systemJournalRecords(input.readCollection(ELEMENT_DESERIALIZER));
b.systemJournalRecords(input.readCollection(ELEMENT_DESERIALIZER, () -> Collections.synchronizedList(new ArrayList<>())));
}

private void write00(SystemJournalRecordBatch object, RevisionDataOutput output) throws IOException {
Expand Down Expand Up @@ -1694,7 +1694,7 @@ private void write00(SegmentSnapshotRecord object, RevisionDataOutput output) th

private void read00(RevisionDataInput input, SegmentSnapshotRecord.SegmentSnapshotRecordBuilder b) throws IOException {
b.segmentMetadata((SegmentMetadata) SEGMENT_METADATA_SERIALIZER.deserialize(input.getBaseStream()));
b.chunkMetadataCollection(input.readCollection(ELEMENT_DESERIALIZER));
b.chunkMetadataCollection(input.readCollection(ELEMENT_DESERIALIZER, () -> Collections.synchronizedList(new ArrayList<>())));
}
}
}
Expand Down Expand Up @@ -1769,7 +1769,7 @@ private void write00(SystemSnapshotRecord object, RevisionDataOutput output) thr
private void read00(RevisionDataInput input, SystemSnapshotRecord.SystemSnapshotRecordBuilder b) throws IOException {
b.epoch(input.readCompactLong());
b.fileIndex(input.readCompactInt());
b.segmentSnapshotRecords(input.readCollection(ELEMENT_DESERIALIZER));
b.segmentSnapshotRecords(input.readCollection(ELEMENT_DESERIALIZER, () -> Collections.synchronizedList(new ArrayList<>())));
}
}
}
Expand Down