rishabhdaim commented on code in PR #1789:
URL: https://github.com/apache/jackrabbit-oak/pull/1789#discussion_r1799177585
##########
oak-store-document/pom.xml:
##########
@@ -43,8 +43,8 @@
<configuration>
<instructions>
<Import-Package>
- com.mongodb*;version="[3.8, 4)";resolution:=optional,
- org.bson*;version="[3.8, 4)";resolution:=optional,
+ com.mongodb*;version="[5.0, 5.2)";resolution:=optional,
Review Comment:
Since we are switching to `5.2.0`, shouldn't it be
```suggestion
com.mongodb*;version="[5.2, 6)";resolution:=optional,
```
##########
oak-store-document/pom.xml:
##########
@@ -43,8 +43,8 @@
<configuration>
<instructions>
<Import-Package>
- com.mongodb*;version="[3.8, 4)";resolution:=optional,
- org.bson*;version="[3.8, 4)";resolution:=optional,
+ com.mongodb*;version="[5.0, 5.2)";resolution:=optional,
+ org.bson*;version="[5.0, 5.2)";resolution:=optional,
Review Comment:
Same as above.
##########
oak-run-commons/src/main/java/org/apache/jackrabbit/oak/index/indexer/document/DocumentStoreIndexerBase.java:
##########
@@ -508,7 +507,7 @@ private void configureEstimators(IndexingProgressReporter
progressReporter) {
private long getEstimatedDocumentCount() {
MongoConnection mongoConnection =
indexHelper.getService(MongoConnection.class);
if (mongoConnection != null) {
- return
mongoConnection.getDatabase().getCollection("nodes").count();
+ return
mongoConnection.getDatabase().getCollection("nodes").countDocuments();
Review Comment:
```suggestion
return
mongoConnection.getDatabase().getCollection("nodes").estimatedDocumentCount();
```
`countDcuments` is very slow. I would use `estimatedDocumentCount` for
faster results.
See
https://www.mongodb.com/community/forums/t/countdocuments-is-extremly-slow/207357
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java:
##########
@@ -2345,11 +2339,6 @@ private boolean withClientSession() {
return connection.getStatus().isClientSessionSupported() &&
useClientSession;
}
- private boolean secondariesWithinAcceptableLag() {
- return getClient().getReplicaSetStatus() == null
- || connection.getStatus().getReplicaSetLagEstimate() <
acceptableLagMillis;
Review Comment:
`acceptableLagMillis` should be marked as deprecated since it won't be used
anymore.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]