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

refactor: refactor controller to use dynamic client and use better ratelimiter for controlled exponential backoff #186

Merged
merged 13 commits into from
Jun 8, 2022

Conversation

abhilashshetty04
Copy link
Contributor

@abhilashshetty04 abhilashshetty04 commented Apr 22, 2022

Signed-off-by: Abhilash Shetty abhilashshetty@abhilashshetty-mbp1.local

Why is this PR required? What issue does it fix?:

What this PR does?:

  1. Replaced codes which implemented code generation and used dynamic client to watch lvmvolume, lvmnode and lvmsnapshot cr
  2. Replaced builder pattern by one func implementation which would create controller struct and return.
  3. Added additional loggers to help debug event triggers.

Snapshot busylooping Fix:
We have changed the ratelimiter which was used in snapshot controller. This ratelimiter requeues failed items after 5 secs for first 12 attempts. Then objects are requeued after 30 secs. I had unloaded dm-snapshot kernel module to reproduce this. Attached logs from the relevant node plugin below.

retrylogs.txt

Issues:

@abhilashshetty04 abhilashshetty04 changed the title [WIP] refactor{vol controller}: refactored controller to use dynamic client rather then code generation [WIP] refactor(vol controller): refactored controller to use dynamic client rather then code generation Apr 22, 2022
@abhilashshetty04 abhilashshetty04 changed the title [WIP] refactor(vol controller): refactored controller to use dynamic client rather then code generation [WIP] refactor: refactor controller to use dynamic client rather then code generation Apr 28, 2022
Copy link
Member

@niladrih niladrih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requested some changes

pkg/mgmt/lvmnode/builder.go Outdated Show resolved Hide resolved
pkg/mgmt/lvmnode/builder.go Show resolved Hide resolved
pkg/mgmt/lvmnode/lvmnode.go Outdated Show resolved Hide resolved
pkg/mgmt/lvmnode/lvmnode.go Outdated Show resolved Hide resolved
pkg/mgmt/snapshot/snapshot.go Outdated Show resolved Hide resolved
pkg/mgmt/snapshot/snapshot.go Outdated Show resolved Hide resolved
pkg/mgmt/volume/volume.go Outdated Show resolved Hide resolved
@niladrih
Copy link
Member

@abhilashshetty04 -- All commits require a DCO signature. Commit e405d3c is not signed. Also, please add a relevant PR description

Abhilash Shetty and others added 7 commits May 24, 2022 22:23
Signed-off-by: Abhilash Shetty <abhilashshetty@abhilashshetty-mbp1.local>
Signed-off-by: Abhilash Shetty <abhilashshetty@abhilashshetty-mbp1.local>
Signed-off-by: Abhilash Shetty <abhilash.shetty@datacore.com>
Signed-off-by: Abhilash Shetty <abhilash.shetty@datacore.com>
…to klog

Signed-off-by: Abhilash Shetty <abhilash.shetty@datacore.com>
Signed-off-by: Abhilash Shetty <abhilash.shetty@datacore.com>
Signed-off-by: Abhilash Shetty <abhilash.shetty@datacore.com>
Signed-off-by: Abhilash Shetty <abhilash.shetty@datacore.com>
Copy link
Member

@niladrih niladrih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few comments @abhilashshetty04.

pkg/mgmt/lvmnode/builder.go Show resolved Hide resolved
pkg/mgmt/lvmnode/lvmnode.go Outdated Show resolved Hide resolved
pkg/mgmt/lvmnode/lvmnode.go Show resolved Hide resolved
pkg/mgmt/snapshot/snapshot.go Outdated Show resolved Hide resolved
pkg/mgmt/lvmnode/start.go Outdated Show resolved Hide resolved
pkg/mgmt/snapshot/snapshot.go Outdated Show resolved Hide resolved
pkg/mgmt/volume/volume.go Outdated Show resolved Hide resolved
pkg/mgmt/volume/volume.go Outdated Show resolved Hide resolved
Signed-off-by: Abhilash Shetty <abhilash.shetty@datacore.com>
Signed-off-by: Abhilash Shetty <abhilash.shetty@datacore.com>
Signed-off-by: Abhilash Shetty <abhilash.shetty@datacore.com>
Copy link
Member

@Ab-hishek Ab-hishek left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. Thanks @abhilashshetty04

Copy link
Member

@niladrih niladrih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One little nitpick

pkg/mgmt/lvmnode/lvmnode.go Outdated Show resolved Hide resolved
Signed-off-by: Abhilash Shetty <abhilash.shetty@datacore.com>
@pawanpraka1 pawanpraka1 merged commit 433301a into openebs:develop Jun 8, 2022
@abhilashshetty04 abhilashshetty04 changed the title [WIP] refactor: refactor controller to use dynamic client rather then code generation [WIP] refactor: refactor controller to use dynamic client and use better ratelimiter for controller backoff Jun 14, 2022
@abhilashshetty04 abhilashshetty04 changed the title [WIP] refactor: refactor controller to use dynamic client and use better ratelimiter for controller backoff [WIP] refactor: refactor controller to use dynamic client and use better ratelimiter for controlled exponential backoff Jun 14, 2022
@abhilashshetty04 abhilashshetty04 changed the title [WIP] refactor: refactor controller to use dynamic client and use better ratelimiter for controlled exponential backoff refactor: refactor controller to use dynamic client and use better ratelimiter for controlled exponential backoff Jun 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants