istio icon indicating copy to clipboard operation
istio copied to clipboard

Donot merge DR with different exportTo

Open hzxuzhonghu opened this issue 1 year ago • 7 comments

Please provide a description of this PR:

Previously we merge VirtualServices resides in a namespace even they exportTo different namespaces. This is not right, #52519 reported a inconsistency with this bug.

Now with this patch, it will check exportTo, not merge them until exportTo equals.

hzxuzhonghu avatar Aug 12 '24 09:08 hzxuzhonghu

@howardjohn @ramaraochavali to have a look and give some feadbacks

hzxuzhonghu avatar Aug 12 '24 12:08 hzxuzhonghu

cc @keithmattix

howardjohn avatar Aug 13 '24 14:08 howardjohn

does the oldest resource heuristic take place first or does exportTo preempt it

I donot think they are correlated, definitely oldest take preference if the exportTo satisfy. If the oldest doesnot satifsy, then find the newer one

I think this is is still a breaking change and at minimum needs to be behind a compatibility version

No, this is not a breaking change. Unless i missed something

hzxuzhonghu avatar Aug 14 '24 01:08 hzxuzhonghu

FIx https://github.com/istio/istio/issues/49409 as well

hzxuzhonghu avatar Aug 19 '24 08:08 hzxuzhonghu

@keithmattix

hzxuzhonghu avatar Aug 19 '24 12:08 hzxuzhonghu

ping @keithmattix

hzxuzhonghu avatar Aug 26 '24 11:08 hzxuzhonghu

ping @howardjohn , seems @keithmattix not get this notification

hzxuzhonghu avatar Aug 28 '24 08:08 hzxuzhonghu

ping @howardjohn @keithmattix how could make the bug fix land down

hzxuzhonghu avatar Aug 30 '24 01:08 hzxuzhonghu

I think I would feel comfortable approving if this is behind a feature flag. As @howardjohn mentioned, we've had a lot of breakage in this area of the code lately, and I'm conscious of minimizing risk

keithmattix avatar Sep 01 '24 23:09 keithmattix

/retest

hzxuzhonghu avatar Sep 05 '24 03:09 hzxuzhonghu

/retest

hzxuzhonghu avatar Sep 05 '24 03:09 hzxuzhonghu

@howardjohn The original issue is on 1.20. #48312 has fixed a case

With this pr feature enabled :

k exec -ti  istiod-6fc7bb65bd-bmpt6      -n istio-system -- curl 127.0.0.1:8080/debug/sidecarz?proxyID=sleep |jq |grep dest -n30
1-{
2:  "destinationRules": {
3-    "httpbin.mesh.global": [
4-      {
5-        "exportTo": {
6-          "default": {},
7-          "test": {}
8-        },
9-        "from": [
10-          {
11-            "Namespace": "test",
12-            "Name": "httpbin-dr"
13-          }
14-        ],
15-        "rule": {
16-          "type": {

With this feature disabled

k exec -ti  istiod-84f5757589-vf5qf    -n istio-system -- curl 127.0.0.1:8080/debug/sidecarz?proxyID=sleep |jq |grep dest -n30
1-{
2:  "destinationRules": {
3-    "httpbin.mesh.global": [
4-      {
5-        "exportTo": {
6-          "default": {},
7-          "test": {}
8-        },
9-        "from": [
10-          {
11-            "Namespace": "test",
12-            "Name": "httpbin-dr"
13-          },
14-          {
15-            "Namespace": "test",
16-            "Name": "httpbin-ingress-dr"
17-          }
18-        ],
19-        "rule": {

hzxuzhonghu avatar Sep 09 '24 09:09 hzxuzhonghu

@howardjohn Can you run the latest code, and have a compare with different exportTo by looking up /debug/sidecarz

hzxuzhonghu avatar Sep 11 '24 02:09 hzxuzhonghu