Uploaded image for project: 'Data Management'
  1. Data Management
  2. DM-23462

Please use an env variable to specify the masterPriority level in the OSPL configuration

    XMLWordPrintable

    Details

    • Type: Story
    • Status: Done
    • Resolution: Done
    • Fix Version/s: None
    • Component/s: ts_middleware
    • Labels:
      None
    • Story Points:
      1
    • Sprint:
      TSSW Sprint - Apr 13 - Apr 27
    • Team:
      Telescope and Site
    • Urgent?:
      No

      Description

      We want to run Scripts with masterPriority=0 in order to make sure that they never become "master", which would trigger an expensive system-wide DDS realignment.

      ADLink knows of no programmatic way to do this, but we can easily use env variable substitution in the ospl.xml configuration file and that variable can be optional. I suggest the following, where masterPriority="${OSPL_MASTER_PRIORITY:-1}" sets the master priority to the env variable OSPL_MASTER_PRIORITY, if defined, else 1. Yes the minus sign is needed (I checked that): the default delimiter really is ":-".

      <DurabilityService name="durability">
          <Network>
              <Alignment>
                  <TimeAlignment>false</TimeAlignment>
                  <RequestCombinePeriod>
                      <Initial>2.5</Initial>
                      <Operational>0.1</Operational>
                  </RequestCombinePeriod>
              </Alignment>
              <WaitForAttachment maxWaitCount="100">
                  <ServiceName>ddsi2</ServiceName>
              </WaitForAttachment>
          </Network>
          <NameSpaces>
              <NameSpace name="defaultNamespace">
                  <Partition>*</Partition>
              </NameSpace>
              <Policy alignee="Initial"
                      aligner="true"
                      durability="Durable"
                      masterPriority="${OSPL_MASTER_PRIORITY:-1}"
                      nameSpace="defaultNamespace"/>
          </NameSpaces>
      </DurabilityService>
      

      This will make it trivial for scripts to assign themselves a masterPriority of 0 and we can also easily assign an early CSC, such as a SAL/Kafka producer, a higher masterPriority.

        Attachments

          Issue Links

            Activity

            Hide
            rowen Russell Owen added a comment - - edited

            If you omit masterPriority (as we currently do) then you get the default value of 255!

            So I don't think it is possible for my suggested change to break our code.

            You can see that if you put the <Tracing> snippet listed above in your DurabilityService section. Here is an excerpt of what I see when I do that:

            - Policies                                    :
                - Policy:
                    - NameSpace        : defaultNamespace
                    - Aligner          : TRUE
                    - Alignee          : INITIAL
                    - DurabilityKind   : ALL
                    - DelayedAlignment : FALSE
                    - EqualityCheck    : FALSE
                    - MasterPriority   : 255
                    - Rules            : NULL
            

            Also I tried it on low-level dds code (the same code I used to test memory leaks). I ran a reader with the following configuration:

                        <Policy alignee="Initial"
                                aligner="true"
                                durability="Durable"
                                masterPriority="${OSPL_MASTER_PRIORITY:-1}"
                                nameSpace="defaultNamespace"/>
            

            and a writer with the same except the masterPriority line is deleted it all works fine.

            I then repeated the test, but reversing configuration for reader and writer. Again it all worked.

            So I suspect something else was wrong.

            I did observe that if I get the

            masterPriority="${OSPL_MASTER_PRIORITY:-1}"
            

            entry wrong (for example if I forget the "-" in ":-1") then I can't do anything with OpenSplice. It's not subtle!

            Show
            rowen Russell Owen added a comment - - edited If you omit masterPriority (as we currently do) then you get the default value of 255! So I don't think it is possible for my suggested change to break our code. You can see that if you put the <Tracing> snippet listed above in your DurabilityService section. Here is an excerpt of what I see when I do that: - Policies : - Policy: - NameSpace : defaultNamespace - Aligner : TRUE - Alignee : INITIAL - DurabilityKind : ALL - DelayedAlignment : FALSE - EqualityCheck : FALSE - MasterPriority : 255 - Rules : NULL Also I tried it on low-level dds code (the same code I used to test memory leaks). I ran a reader with the following configuration: <Policy alignee="Initial" aligner="true" durability="Durable" masterPriority="${OSPL_MASTER_PRIORITY:-1}" nameSpace="defaultNamespace"/> and a writer with the same except the masterPriority line is deleted it all works fine. I then repeated the test, but reversing configuration for reader and writer. Again it all worked. So I suspect something else was wrong. I did observe that if I get the masterPriority="${OSPL_MASTER_PRIORITY:-1}" entry wrong (for example if I forget the "-" in ":-1") then I can't do anything with OpenSplice. It's not subtle!
            Hide
            dmills Dave Mills added a comment -

            Although it seems to work , I see the following in ospl-error.log which does not inspire confidence

            ========================================================================================
            Report : ERROR
            Date : 2020-03-11T14:52:48-0700
            Description : I use priorities for namespace 'defaultNamespace' while fellow 1334756983 uses the legacy master selection algorithm, this is an incompatible and unsupported configuration
            Node : localhost.localdomain
            Process : sacpp_Test_softwareVersions_send <23961>
            Thread : d_nameSpaces 7fb237740700
            Internals : 6.9.181127OSS/42c7caf/42c7caf/namespace_compatibility_check/d_nameSpacesListener.c/235/0/1583963568.370466129/0

            Show
            dmills Dave Mills added a comment - Although it seems to work , I see the following in ospl-error.log which does not inspire confidence ======================================================================================== Report : ERROR Date : 2020-03-11T14:52:48-0700 Description : I use priorities for namespace 'defaultNamespace' while fellow 1334756983 uses the legacy master selection algorithm, this is an incompatible and unsupported configuration Node : localhost.localdomain Process : sacpp_Test_softwareVersions_send <23961> Thread : d_nameSpaces 7fb237740700 Internals : 6.9.181127OSS/42c7caf/42c7caf/namespace_compatibility_check/d_nameSpacesListener.c/235/0/1583963568.370466129/0
            Hide
            rowen Russell Owen added a comment -

            That's convincing!

            Show
            rowen Russell Owen added a comment - That's convincing!
            Show
            dmills Dave Mills added a comment - https://github.com/lsst-ts/ts_opensplice/pull/4
            Hide
            rowen Russell Owen added a comment -

            Thank you very much for making the change.

            Please consider also updating OpenSpliceDDS/V6.4.1Community/HDE/x86_64.linux/etc/config/ospl.xml
            to match (or getting rid of that set of directories if we're not using it)

            Show
            rowen Russell Owen added a comment - Thank you very much for making the change. Please consider also updating OpenSpliceDDS/V6.4.1Community/HDE/x86_64.linux/etc/config/ospl.xml to match (or getting rid of that set of directories if we're not using it)

              People

              Assignee:
              dmills Dave Mills
              Reporter:
              rowen Russell Owen
              Reviewers:
              Russell Owen
              Watchers:
              Dave Mills, Russell Owen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Jenkins

                  No builds found.