Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-71453

Change count command from BasicCommand to IDL typed command

    • Type: Icon: Task Task
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Execution

      Today, the count command is a BasicCommand. We are going to change it to IDL typed command for the following reason:

      • To pass in tenant information. There is no way to access the original request's validate tenant scope from run() function of BasicCommand. We need the tenant information to have the internal generated aggregation request run correctly.
      • To have the right access contractor for this command. BasicCommand has empty access contractor. But, count command as a version 1 stable api, it should have an access contractor which is defined in its idl file.

      We should consider the following points when we doing this. 

      • the reply object. Currently, in count_command.idl, the reply type is OkReply. It's not correct as counter command should return "n" field in reply message.
      • the data type for "n" field. Currently, it's serialized with appendNumber function which can serialize data into either 32 bit int or 64 bit int. We should keep this behavior so that we will not break driver and user's code. But, the IDL compiler has no any type matching this requirement. Need more investigation on how to do it.
      • the impact on api compatibility as we need to add a  new access check item to the access check list. It's "should_ignore_auth_checks" as `count` command calls the function `shouldIgnoreAuthChecks. 
      • some unit test and jstest files will be impacted if they pass in an invalid count request as IDL parser checks request body more carefully. 

            Assignee:
            Unassigned Unassigned
            Reporter:
            sophia.tan@mongodb.com Sophia Tan
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated: