Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-42840

Clean up Subscription configMap during event API upgrade

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 4.17
    • Networking / ptp
    • Moderate
    • Yes
    • CNF RAN Sprint 260
    • 1
    • False
    • Hide

      None

      Show
      None
    • Release Note Not Required
    • In Progress

      During upgrade of event api from v1 to v2, the old configMap for event subscriptions is not cleaned up.

      Test Steps:

      1. Deploy ptp-operator with v1 event, ptpEventConfig.apiVersion="1.0" or not set.
      2. Deploy v1 consumer with sidecar. Check configmap for subscriptions is created.
      3. Update the default ptpoperatorconfig with ptpEventConfig.apiVersion="2.0"
      4. Undeploy v1 consumer and deploy v2 consumer without sidecar.

      Result:
      The v2 consumer subscriptions are added to the configMap with a different cliendID. The old configMap with cliendID of v1 consumer is not cleaned up.

      $ oc -n openshift-ptp get configmap cnfdg4.ptp.eng.rdu2.dc.redhat.com -o yaml
      apiVersion: v1
      data:
        89cf9237-5a94-384b-bbb0-67739967f256: |-
          {
           "clientID": "89cf9237-5a94-384b-bbb0-67739967f256",
           "subStore": {
            "store": {
             "022ca537-c503-4f72-80be-48a3c7cbecf4": {
              "resource": "/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/sync-status/sync-state",
              "endpointUri": "",
              "id": "022ca537-c503-4f72-80be-48a3c7cbecf4"
             },
             "71ef374a-ddad-4c46-b05b-7f3069bb3ed6": {
              "resource": "/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/sync-status/os-clock-sync-state",
              "endpointUri": "",
              "id": "71ef374a-ddad-4c46-b05b-7f3069bb3ed6"
             },
             "8510cfa7-c60c-42bf-a9e5-dfd856c9c4d5": {
              "resource": "/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/ptp-status/lock-state",
              "endpointUri": "",
              "id": "8510cfa7-c60c-42bf-a9e5-dfd856c9c4d5"
             },
             "8c47a60f-e5c2-48f0-a8cc-0f9355e3f27f": {
              "resource": "/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/gnss-status/gnss-sync-status",
              "endpointUri": "",
              "id": "8c47a60f-e5c2-48f0-a8cc-0f9355e3f27f"
             },
             "cccc1ebb-0b13-48e1-9616-35f5d06f4a0e": {
              "resource": "/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/ptp-status/clock-class",
              "endpointUri": "",
              "id": "cccc1ebb-0b13-48e1-9616-35f5d06f4a0e"
             }
            }
           },
           "EndpointUri": "http://consumer-events-subscription-service.cloud-events.svc.cluster.local:9043",
           "status": 1,
           "action": 0
          }
        d98b6979-11cc-378e-952f-32b2be0f5b9e: |-
          {
           "clientID": "d98b6979-11cc-378e-952f-32b2be0f5b9e",
           "subStore": {
            "store": {
             "8193b7bb-8e59-4bac-875e-4182936947bd": {
              "ResourceAddress": "/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/ptp-status/clock-class",
              "EndpointUri": "http://consumer-events-subscription-service.cloud-events.svc.cluster.local:9043/event",
              "SubscriptionId": "8193b7bb-8e59-4bac-875e-4182936947bd",
              "UriLocation": "http://ptp-event-publisher-service-cnfdg4.openshift-ptp.svc.cluster.local:9043/api/ocloudNotifications/v2/subscriptions/8193b7bb-8e59-4bac-875e-4182936947bd"
             },
             "869dc84a-0876-4aa1-8669-568142086161": {
              "ResourceAddress": "/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/gnss-status/gnss-sync-status",
              "EndpointUri": "http://consumer-events-subscription-service.cloud-events.svc.cluster.local:9043/event",
              "SubscriptionId": "869dc84a-0876-4aa1-8669-568142086161",
              "UriLocation": "http://ptp-event-publisher-service-cnfdg4.openshift-ptp.svc.cluster.local:9043/api/ocloudNotifications/v2/subscriptions/869dc84a-0876-4aa1-8669-568142086161"
             },
             "a1d20284-8dc2-405d-b002-e12ae1526391": {
              "ResourceAddress": "/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/sync-status/sync-state",
              "EndpointUri": "http://consumer-events-subscription-service.cloud-events.svc.cluster.local:9043/event",
              "SubscriptionId": "a1d20284-8dc2-405d-b002-e12ae1526391",
              "UriLocation": "http://ptp-event-publisher-service-cnfdg4.openshift-ptp.svc.cluster.local:9043/api/ocloudNotifications/v2/subscriptions/a1d20284-8dc2-405d-b002-e12ae1526391"
             },
             "bc192f29-8aa0-426d-bfa1-e0e3562cc98a": {
              "ResourceAddress": "/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/sync-status/os-clock-sync-state",
              "EndpointUri": "http://consumer-events-subscription-service.cloud-events.svc.cluster.local:9043/event",
              "SubscriptionId": "bc192f29-8aa0-426d-bfa1-e0e3562cc98a",
              "UriLocation": "http://ptp-event-publisher-service-cnfdg4.openshift-ptp.svc.cluster.local:9043/api/ocloudNotifications/v2/subscriptions/bc192f29-8aa0-426d-bfa1-e0e3562cc98a"
             },
             "d88584c3-8a8e-4fd0-9dcb-c105d11afc6e": {
              "ResourceAddress": "/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/ptp-status/lock-state",
              "EndpointUri": "http://consumer-events-subscription-service.cloud-events.svc.cluster.local:9043/event",
              "SubscriptionId": "d88584c3-8a8e-4fd0-9dcb-c105d11afc6e",
              "UriLocation": "http://ptp-event-publisher-service-cnfdg4.openshift-ptp.svc.cluster.local:9043/api/ocloudNotifications/v2/subscriptions/d88584c3-8a8e-4fd0-9dcb-c105d11afc6e"
             }
            }
           },
           "EndpointUri": "http://consumer-events-subscription-service.cloud-events.svc.cluster.local:9043/event",
           "status": 1,
           "action": 0
          }
      kind: ConfigMap
      metadata:
        creationTimestamp: "2024-10-07T20:18:39Z"
        name: cnfdg4.ptp.eng.rdu2.dc.redhat.com
        namespace: openshift-ptp
        resourceVersion: "34807172"
        uid: 1ebd63fd-d9d9-426f-a158-94f334f009e2
      

      Expected Result:
      V1 subcriptions should be cleaned up from the configMap.

      More Logs
      Logs of producer sidecar in Step 3:

      ----- logs for cloud-event-proxy ------
      time="2024-10-07T20:21:49Z" level=info msg="transport host path is set to  http://ptp-event-publisher-service-cnfdg4.openshift-ptp.svc.cluster.local:9043"
      time="2024-10-07T20:21:49Z" level=info msg="reloading subscribers from the store /store"
      time="2024-10-07T20:21:49Z" level=info msg="0 registered clients reloaded"
      time="2024-10-07T20:21:49Z" level=info msg="persisting following contents {\n \"clientID\": \"89cf9237-5a94-384b-bbb0-67739967f256\",\n \"subStore\": {\n  \"store\": {\n   \"022ca537-c503-4f72-80be-48a3c7cbecf4\": {\n    \"resource\": \"/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/sync-status/sync-state\",\n    \"endpointUri\": \"\",\n    \"id\": \"022ca537-c503-4f72-80be-48a3c7cbecf4\"\n   },\n   \"71ef374a-ddad-4c46-b05b-7f3069bb3ed6\": {\n    \"resource\": \"/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/sync-status/os-clock-sync-state\",\n    \"endpointUri\": \"\",\n    \"id\": \"71ef374a-ddad-4c46-b05b-7f3069bb3ed6\"\n   },\n   \"8510cfa7-c60c-42bf-a9e5-dfd856c9c4d5\": {\n    \"resource\": \"/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/ptp-status/lock-state\",\n    \"endpointUri\": \"\",\n    \"id\": \"8510cfa7-c60c-42bf-a9e5-dfd856c9c4d5\"\n   },\n   \"8c47a60f-e5c2-48f0-a8cc-0f9355e3f27f\": {\n    \"resource\": \"/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/gnss-status/gnss-sync-status\",\n    \"endpointUri\": \"\",\n    \"id\": \"8c47a60f-e5c2-48f0-a8cc-0f9355e3f27f\"\n   },\n   \"cccc1ebb-0b13-48e1-9616-35f5d06f4a0e\": {\n    \"resource\": \"/cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/ptp-status/clock-class\",\n    \"endpointUri\": \"\",\n    \"id\": \"cccc1ebb-0b13-48e1-9616-35f5d06f4a0e\"\n   }\n  }\n },\n \"EndpointUri\": \"http://consumer-events-subscription-service.cloud-events.svc.cluster.local:9043\",\n \"status\": 1,\n \"action\": 0\n} to a file /store/89cf9237-5a94-384b-bbb0-67739967f256.json\n"
      time="2024-10-07T20:21:49Z" level=info msg="starting metrics"
      time="2024-10-07T20:21:49Z" level=info msg="v2 rest api set scConfig.APIPort=9043, scConfig.APIPath=/api/ocloudNotifications/v2/, scConfig.TransportHost.Port=9085"
      time="2024-10-07T20:21:49Z" level=info msg="reloading subscribers from the store /store"
      time="2024-10-07T20:21:49Z" level=info msg="1 registered clients reloaded"
      time="2024-10-07T20:21:49Z" level=info msg="registered clients 89cf9237-5a94-384b-bbb0-67739967f256 :   EndpointUri: http://consumer-events-subscription-service.cloud-events.svc.cluster.local:9043\n  clientID: 89cf9237-5a94-384b-bbb0-67739967f256\n  sub :{ {  EndpointUri: \n  UriLocation: \n  SubscriptionId: 8510cfa7-c60c-42bf-a9e5-dfd856c9c4d5\n  Resource: /cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/ptp-status/lock-state\n\n }, {  EndpointUri: \n  UriLocation: \n  SubscriptionId: 8c47a60f-e5c2-48f0-a8cc-0f9355e3f27f\n  Resource: /cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/gnss-status/gnss-sync-status\n\n }, {  EndpointUri: \n  UriLocation: \n  SubscriptionId: cccc1ebb-0b13-48e1-9616-35f5d06f4a0e\n  Resource: /cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/ptp-status/clock-class\n\n }, {  EndpointUri: \n  UriLocation: \n  SubscriptionId: 022ca537-c503-4f72-80be-48a3c7cbecf4\n  Resource: /cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/sync-status/sync-state\n\n }, {  EndpointUri: \n  UriLocation: \n  SubscriptionId: 71ef374a-ddad-4c46-b05b-7f3069bb3ed6\n  Resource: /cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/sync-status/os-clock-sync-state\n\n }, }"
      time="2024-10-07T20:21:49Z" level=info msg="reloading subscribers from the store /store"
      time="2024-10-07T20:21:49Z" level=info msg="1 registered clients reloaded"
      time="2024-10-07T20:21:49Z" level=info msg="registered clients 89cf9237-5a94-384b-bbb0-67739967f256 :   EndpointUri: http://consumer-events-subscription-service.cloud-events.svc.cluster.local:9043\n  clientID: 89cf9237-5a94-384b-bbb0-67739967f256\n  sub :{ {  EndpointUri: \n  UriLocation: \n  SubscriptionId: 022ca537-c503-4f72-80be-48a3c7cbecf4\n  Resource: /cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/sync-status/sync-state\n\n }, {  EndpointUri: \n  UriLocation: \n  SubscriptionId: 71ef374a-ddad-4c46-b05b-7f3069bb3ed6\n  Resource: /cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/sync-status/os-clock-sync-state\n\n }, {  EndpointUri: \n  UriLocation: \n  SubscriptionId: 8510cfa7-c60c-42bf-a9e5-dfd856c9c4d5\n  Resource: /cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/ptp-status/lock-state\n\n }, {  EndpointUri: \n  UriLocation: \n  SubscriptionId: 8c47a60f-e5c2-48f0-a8cc-0f9355e3f27f\n  Resource: /cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/gnss-status/gnss-sync-status\n\n }, {  EndpointUri: \n  UriLocation: \n  SubscriptionId: cccc1ebb-0b13-48e1-9616-35f5d06f4a0e\n  Resource: /cluster/node/cnfdg4.ptp.eng.rdu2.dc.redhat.com/sync/ptp-status/clock-class\n\n }, }"
      

              jacding@redhat.com Jack Ding
              jacding@redhat.com Jack Ding
              Bonnie Block Bonnie Block
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated: