From ddea0582bf4f377e67716c84e98f4329a7bd6409 Mon Sep 17 00:00:00 2001 From: Cristian Goina Date: Sun, 28 Apr 2024 15:25:11 -0400 Subject: [PATCH] prefer primary for db reads --- .../colormipsearch/dao/mongo/support/MongoDBHelper.java | 4 +--- .../colormipsearch/cmd/dataexport/LMCDMatchesExporter.java | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/colormipsearch-persist/src/main/java/org/janelia/colormipsearch/dao/mongo/support/MongoDBHelper.java b/colormipsearch-persist/src/main/java/org/janelia/colormipsearch/dao/mongo/support/MongoDBHelper.java index 9af3d6ac..5513fdda 100644 --- a/colormipsearch-persist/src/main/java/org/janelia/colormipsearch/dao/mongo/support/MongoDBHelper.java +++ b/colormipsearch-persist/src/main/java/org/janelia/colormipsearch/dao/mongo/support/MongoDBHelper.java @@ -52,10 +52,8 @@ public static MongoClient createMongoClient( MongoClientSettings.getDefaultCodecRegistry(), codecRegistry)) .writeConcern(WriteConcern.JOURNALED) - .readConcern(ReadConcern.AVAILABLE) - .readPreference(ReadPreference.secondaryPreferred()) + .readPreference(ReadPreference.primaryPreferred()) .retryWrites(true) - .retryReads(true) .applyToConnectionPoolSettings(builder -> { if (connectionsPerHost > 0) { builder.maxSize(connectionsPerHost); diff --git a/colormipsearch-tools/src/main/java/org/janelia/colormipsearch/cmd/dataexport/LMCDMatchesExporter.java b/colormipsearch-tools/src/main/java/org/janelia/colormipsearch/cmd/dataexport/LMCDMatchesExporter.java index 38d9f950..64a476c4 100644 --- a/colormipsearch-tools/src/main/java/org/janelia/colormipsearch/cmd/dataexport/LMCDMatchesExporter.java +++ b/colormipsearch-tools/src/main/java/org/janelia/colormipsearch/cmd/dataexport/LMCDMatchesExporter.java @@ -86,7 +86,7 @@ private void runExportForTargetIds(int jobId, List targetMipIds) { long startProcessingTime = System.currentTimeMillis(); LOG.info("Start processing {} targets from partition {}", targetMipIds.size(), jobId); targetMipIds.forEach(targetMipId -> { - LOG.info("Read LM color depth matches for {}", targetMipId); + LOG.info("Read LM color depth matches for mip {}", targetMipId); List> allMatchesForTarget = neuronMatchesReader.readMatchesByTarget( dataSourceParam.getAlignmentSpace(), /* maskLibraries */targetLibraries, // for LM -> EM targetLibraries should be EM libraries so they are mask libs