thomasmueller commented on a change in pull request #367:
URL: https://github.com/apache/jackrabbit-oak/pull/367#discussion_r705423851



##########
File path: 
oak-core/src/main/java/org/apache/jackrabbit/oak/plugins/index/IndexUpdate.java
##########
@@ -280,10 +288,25 @@ private void collectIndexEditors(NodeBuilder definitions,
             NodeBuilder definition = definitions.getChildNode(name);
             if (isIncluded(rootState.async, definition)) {
                 String type = definition.getString(TYPE_PROPERTY_NAME);
+                String primaryType = 
definition.getName(JcrConstants.JCR_PRIMARYTYPE);
                 if (type == null) {
                     // probably not an index def
                     continue;
                 }
+                /*
+                 Log a warning after every indexJcrTypeInvalidLogLimiter 
cycles of indexer where nodeState changed.
+                 and skip further execution for invalid nodetype of index 
definition.
+                 */
+                if 
(!IndexConstants.INDEX_DEFINITIONS_NODE_TYPE.equals(primaryType)) {
+                    // It is a cyclic counter which reset back to 0 after 
INDEX_JCR_TYPE_INVALID_LOG_LIMITER
+                    // This is to sparsely log this warning.
+                    if ((cyclicExecutionCount >= 
INDEX_JCR_TYPE_INVALID_LOG_LIMITER)) {

Review comment:
       With this logic, it will log after 1000 executions. That is, with a 
delay of 5 seconds, after 5000 seconds, or 83 minutes.
   
   It would be better to log in the first call as well - you see I keep coming 
back to the original 
   
       executionCount % INDEX_JCR_TYPE_INVALID_LOG_LIMITER == 0
   




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


Reply via email to