Skip to content

outlier detection: max_ejection_percent interfered by stats matcher unexpectedly #8259

Closed

Description

@lizan

Description:
From istio/istio#17004,

Envoy use the stats key
(

double ejected_percent = 100.0 * stats_.ejections_active_.value() / host_monitors_.size();
)
cluster.outbound|80||asm-test-http.default.svc.cluster.local.outlier_detection.ejections_active to record the count of the pods that be ejected in the cluster now

the statsMatcher in the envoy bootstrap config is

  "statsMatcher": {
                "inclusionList": {
                    "patterns": [
                        {
                            "prefix": "cluster_manager"
                        },
                        {
                            "prefix": "listener_manager"
                        },
                        {
                            "prefix": "http_mixer_filter"
                        },
                        {
                            "prefix": "tcp_mixer_filter"
                        },
                        {
                            "prefix": "server"
                        },
                        {
                            "prefix": "cluster.xds-grpc"
                        }
                    ]
                }
            }
        },

cluster.outbound is not in the statsMatcher.inclusionList
so the counter ejections_active will be NullCounterImpl and always return zero

it cause the field maxEjectionPercent failure to limit the number of ejected nodes

Repro steps:
See istio/istio#17004

Activity

  1. stale commented on Oct 16, 2019

    @stale

    This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.

  2. added
    stale
    on Oct 16, 2019
  3. stale commented on Oct 23, 2019

    @stale

    This issue has been automatically closed because it has not had activity in the last 37 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.

  4. added
    help wanted
    and removed
    stale
    on Nov 13, 2019
  5. reopened this on Nov 13, 2019
  6. nicktrav commented on Jan 16, 2020

    @nicktrav
    Contributor

    Recapping a conversation I had with @snowp on this - in the event that someone wants to pick this up that knows the Envoy codebase better than I.

    If ejections_active_ is filtered out (i.e. not enabled via inclusion of the metric) the following always comes out as zero:

    double ejected_percent = 100.0 * stats_.ejections_active_.value() / host_monitors_.size();

    This results in the ejection branch of the if/else block always being run, which will eject all endpoints in the cluster if run enough.

    Conceptually this should not be hard to fix that, we just need to track the value in the outlier detector instance, rather than relying on reading from the stats store.

    Correct me if any of this is inaccurate, @snowp, or if you have other thoughts on this.

  7. oblazek commented on Mar 19, 2020

    @oblazek

    I can confirm the same behavior in different envoy version. When these stats are filtered out envoy will eject all hosts in a cluster (and doesn't honor MaxEjectionPercent).

  8. cpakulski commented on Oct 22, 2020

    @cpakulski
    Contributor

    I think that this issue has been fixed by #11629. @lambdai please confirm, so it can be closed.

  9. lambdai commented on Oct 22, 2020

    @lambdai
    Contributor

    @cpakulski Yes #11629 is the fix. Thank you for linking it

  10. ryant1986 commented on Feb 29, 2024

    @ryant1986

    Hi, I'm seeing this behavior in istio 1.14, even after attempting to add the necessary stats to work around it

          proxyStatsMatcher:
            inclusionPrefixes:
              - "cluster_outlier"
              - "cluster_outbound"
              - "cluster.outbound"
            inclusionRegexps:
              - ".*cluster_outbound.*"
              - ".*cluster.outbound.*"
              - ".*outlier_detection.*"
              - ".*ejections_active.*"
    

    I've confirmed that this isn't an issue in newer versions (1.20.2). I'd like to get this working in an older version which we'll be running for some time in certain environments before we upgrade. Can you confirm whether this stat configuration should fix my problem, and if not, what else I should try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bughelp wanted

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions