Skip to content

Commit

Permalink
prefer primary for db reads
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristian Goina committed Apr 28, 2024
1 parent 4b1ca48 commit ddea058
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private void runExportForTargetIds(int jobId, List<String> 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<CDMatchEntity<? extends AbstractNeuronEntity, ? extends AbstractNeuronEntity>> allMatchesForTarget = neuronMatchesReader.readMatchesByTarget(
dataSourceParam.getAlignmentSpace(),
/* maskLibraries */targetLibraries, // for LM -> EM targetLibraries should be EM libraries so they are mask libs
Expand Down

0 comments on commit ddea058

Please sign in to comment.