mreutegg commented on a change in pull request #299:
URL: https://github.com/apache/jackrabbit-oak/pull/299#discussion_r658069004



##########
File path: 
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoVersionGCSupport.java
##########
@@ -136,7 +136,7 @@ protected SplitDocumentCleanUp 
createCleanUp(Set<SplitDocType> gcTypes,
             // makes any future similar problem more visible than long running
             // queries alone (15min is still long).
             Iterable<NodeDocument> iterable = 
filter(transform(getNodeCollection().find(query)
-                    .maxTime(15, TimeUnit.MINUTES),
+                    .maxTime(15, 
TimeUnit.MINUTES).hintString("_sdType_1__sdMaxRevTime_1"),

Review comment:
       This name looks somewhat cryptic and generated by MongoDB. Is this 
something we can rely on? What happens when there is no such index? Will the 
query fail or MongoDB just silently ignore the hint? The reason why I'm asking 
is because there are cases where Oak does not automatically created that index. 
See 
https://github.com/apache/jackrabbit-oak/blob/72203f3928226a26ea22197aed9c8901605618f2/oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoDocumentStore.java#L354
   
   I'm also wondering whether it is possible to read the name of the index from 
MongoDB or use the other method variant `hint(Bson)`. I was hoping the latter 
does not depend on how MongoDB generates a name for the index.




-- 
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.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to