EnMasseProject / enmasse

EnMasse - Self-service messaging on Kubernetes and OpenShift
https://enmasseproject.github.io
Apache License 2.0
190 stars 87 forks source link

Deleting topics that have durable subscribers attached leaves "unlinked" subscribers behind #1567

Open RH-sdavey opened 6 years ago

RH-sdavey commented 6 years ago

When deleting a topic that has 1 or more subscribers attached, the topic is deleted fine however the subscribers that were attached are left behind, these could be deleted, or it should not be possible to delete the topic with subscribers attached. If another topic is created with the exact same name, these existing subscribers receive the messages sent to the new topic.

After deletion of the topic "goodtopic" , oc get -o json addresses shows,

{
    "apiVersion": "v1",
    "items": [
        {
            "apiVersion": "enmasse.io/v1alpha1",
            "kind": "Address",
            "metadata": {
                "addressSpace": "dur-sub-test-addr",
                "annotations": {
                    "cluster_id": "broker",
                    "enmasse.io/broker-id": "broker-0"
                },
                "creationTimestamp": "2018-08-30T17:29:46Z",
                "name": "dur-sub-test-addr.sub1.4d0ae56f-530e-4d4f-97f7-edc4624bdf19",
                "namespace": "myproject",
                "resourceVersion": "3011",
                "selfLink": "/apis/enmasse.io/v1alpha1/namespaces/myproject/addressspaces/dur-sub-test-addr",
                "uid": "49ee7403-ac7a-11e8-934d-3440b5d4eb20"
            },
            "spec": {
                "address": "sub1",
                "plan": "standard-subscription",
                "topic": "goodtopic",                <-------------------------------
                "type": "subscription"
            },
            "status": {
                "isReady": true,
                "phase": "Active"
            }
        },
        {
            "apiVersion": "enmasse.io/v1alpha1",
            "kind": "Address",
            "metadata": {
                "addressSpace": "dur-sub-test-addr",
                "annotations": {
                    "cluster_id": "broker",
                    "enmasse.io/broker-id": "broker-0"
                },
                "creationTimestamp": "2018-08-30T17:29:57Z",
                "name": "dur-sub-test-addr.sub2.ef9983c8-e4ee-2b4b-8e49-3cd712ee8c70",
                "namespace": "myproject",
                "resourceVersion": "3036",
                "selfLink": "/apis/enmasse.io/v1alpha1/namespaces/myproject/addressspaces/dur-sub-test-addr",
                "uid": "50864293-ac7a-11e8-934d-3440b5d4eb20"
            },
            "spec": {
                "address": "sub2",
                "plan": "standard-subscription",
                "topic": "goodtopic",       <---------------------------------
                "type": "subscription"
            },
            "status": {
                "isReady": true,
                "phase": "Active"
            }
        }
    ],
    "kind": "List",
    "metadata": {
        "resourceVersion": "",
        "selfLink": ""
    }
}
RH-sdavey commented 5 years ago