Uploaded image for project: 'Jackrabbit Oak'
  1. Jackrabbit Oak
  2. OAK-9880

Simplify rgc DEFAULT_NO_BRANCH query

    XMLWordPrintableJSON

Details

    • Task
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.46.0
    • mongomk
    • None

    Description

      We have seen a repeat of long running rgc remove operations - similarly to what was described in OAK-8351.

      This time happening with the query generated by queryForDefaultNoBranch with the query shape for example similar to:

      {
          "_sdType" : 70,
          "_sdMaxRevTime" : {
              "$lt" : NumberLong(1603030303)
          },
          "$or" : [
              {
                  "$or" : [
                      {
                          "_id" : /.*-1\/0/
                          },
                      {
                          "_id" : /[^-]*/,
                          "_path" : /.*-1\/0/
                      }
              ],
                  "_sdMaxRevTime" : {
                      "$lt" : NumberLong(1602020202)
                  }
              },
              {
                  "$or" : [
                      {
                          "_id" : /.*-2\/0/
                          },
                      {
                          "_id" : /[^-]*/,
                          "_path" : /.*-2/0/
                      }
              ],
                  "_sdMaxRevTime" : {
                      "$lt" : NumberLong(1601010101)
                  }
              }
      }
      

      While setting an index filter with the query plan in mongodb is one option, we could additionally also look into simplifying the above query further into multiple queries : eg. by having 1 query per clusterNodeId, and then simplifying the _sdMaxRevTime accordingly, so that the above would translate into the following 2 queries (with the hope that mongodb finds the optimal query plan) :

      {
          "_sdType" : 70,
          "_sdMaxRevTime" : {
              "$lt" : NumberLong(1602020202)
          },
          "$or" : [
              {
                  "_id" : /.*-1\/0/
              },
              {
                  "_id" : /[^-]*/,
                  "_path" : /.*-1\/0/
              }
          }
      }
      

      and

      {
          "_sdType" : 70,
          "_sdMaxRevTime" : {
              "$lt" : NumberLong(1601010101)
          },
          "$or" : [
              {
                  "_id" : /.*-2\/0/
              },
              {
                  "_id" : /[^-]*/,
                  "_path" : /.*-2\/0/
              }
          }
      }
      

      Attachments

        Issue Links

          Activity

            People

              stefanegli Stefan Egli
              stefanegli Stefan Egli
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: