Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make PVC scaling more idempotent & resilient to crashes #838

Merged
merged 5 commits into from
Sep 23, 2021

Commits on Sep 8, 2021

  1. Extract PVC scaling to its own package

    This allows for this section of the code to have its own test suite,
    without relying on the restrictions placed by envtest. This allows us to
    test more scenarios, such as where a controller has previously crashed
    and left the existing API objects in a bad state (e.g. statefulsets
    missing, PVCs being the wrong size, etc.).
    
    This also fixes #782, as the process of scaling PVCs should now be more
    idempotent than before:
    - StatefulSets don't need to be present on the cluster in order to scale
    the PVCs (as long as the PVCs exist)
    - PVC scaling is done on a PVC-by-PVC case, rather than all at once, so
    that if one or more replicas have already scaled their PVCs it does not
    block the others
    - The current size of PVCs is determined by the live reading of the K8s
    API, rather than what's reported in the RabbitmqCluster object.
    coro committed Sep 8, 2021
    Configuration menu
    Copy the full SHA
    3700171 View commit details
    Browse the repository at this point in the history

Commits on Sep 9, 2021

  1. Fix integration tests

    coro committed Sep 9, 2021
    Configuration menu
    Copy the full SHA
    9f83b5e View commit details
    Browse the repository at this point in the history

Commits on Sep 16, 2021

  1. Configuration menu
    Copy the full SHA
    2961d70 View commit details
    Browse the repository at this point in the history

Commits on Sep 22, 2021

  1. Fix nil pointer exception

    when not defining replicas in Go struct
    
    Before this commit, when replicas was not defined as in:
        Spec: rabbitmqv1beta1.RabbitmqClusterSpec{
                Replicas: &one,
        },
    
    unit tests were failing.
    
    Replicas is an optional field.
    If not set, it should default to 1 instead of causing a panic.
    ansd committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    d952399 View commit details
    Browse the repository at this point in the history
  2. Do not pollute info logs

    Before this commit huge "Found exising PVCs" logs
    were output after every reconcilication even though PVCs didn't get
    resized.
    
    "By default logr's V(0) is zap's InfoLevel and V(1) is zap's DebugLevel (which is numerically -1)."
    ansd committed Sep 22, 2021
    Configuration menu
    Copy the full SHA
    b9c1716 View commit details
    Browse the repository at this point in the history