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

Rewritten list query, test and fix [#82] #83

Merged
merged 4 commits into from
Feb 21, 2024

Conversation

miro-balaz
Copy link
Contributor

Solves #82

Adds test to expose slowness of list query (#82)
Original list query had maybe quadratic complexity (plot) in terms of number of rows with same name.
New query passes the test, it still has superlinear complexity. But it has to be taken with grain of salt as I meassured individual updates.

Test performs two subsequents batches of 1000 updates.

Orignal query

  • duration of first batch: 18 320 405 224ns
  • duration of subsequent batch: 105 316 382 474ns

New Query

  • duration of first batch: 2 372 000 975ns
  • duration of subsequent batch duration: 2 684 759 515ns

Future work: By having specialized query for getting single name,(no prefix or range), we can have even faster, constant time complexity of list.

@ktsakalozos
Copy link
Member

Thank you for this PR @miro-balaz stay tuned for a proper review.

@ktsakalozos
Copy link
Member

You can install MicroK8s with this patch with:

sudo snap install microk8s --classic --channel=latest/edge/dqlite-list

Copy link
Member

@berkayoz berkayoz left a comment

Choose a reason for hiding this comment

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

Hey @miro-balaz,

Proposed list query seems to perform better under general circumstances where number of updated rows(with same name) are generally small. So LGTM.

Before merging, could you please verify you have submitted the CLA form? (If you are a first time contributor) And could you also rebase the PR to include the CLA check workflow?

Thanks.

@ktsakalozos
Copy link
Member

@miro-balaz thank you for this work we would like to merge it. Could you please rebase and sign the CLA so we can distribute the code? Thank you.

@miro-balaz
Copy link
Contributor Author

miro-balaz commented Feb 20, 2024 via email

Copy link
Member

@berkayoz berkayoz left a comment

Choose a reason for hiding this comment

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

I've went ahead with the rebase, everything seems to be good to go.

I'll go ahead with the merge,
Thanks @miro-balaz

@miro-balaz
Copy link
Contributor Author

miro-balaz commented Feb 26, 2024 via email

shayancanonical pushed a commit to canonical/mysql-router-k8s-operator that referenced this pull request Aug 30, 2024
This PR contains the following updates:

| Package | Update | Change |
|---|---|---|
| [canonical/microk8s](https://togithub.com/canonical/microk8s) | minor
| `1.28` -> `1.31` |

---

### Release Notes

<details>
<summary>canonical/microk8s (canonical/microk8s)</summary>

###
[`v1.31`](https://togithub.com/canonical/microk8s/releases/tag/v1.31):
MicroK8s 1.31 released!

[Compare
Source](https://togithub.com/canonical/microk8s/compare/v1.30...v1.31)

#### In this release

##### Kubernetes 1.31

Read more at
https://kubernetes.io/blog/2024/08/13/kubernetes-v1-31-release/

##### Dqlite efficiency

We spent a lot of effort in improving the efficiency of the default
datastore, [dqlite](https://togithub.com/canonical/k8s-dqlite). You will
find improvements in the performance of concurrent queries and open
telemetry integration.

##### Important updates

-   helm upgrade to v3.14.4
-   cert-manager to v1.14.5
-   cilium to v1.15.2
-   gopaddle to v5.0
-   falco to v4.5.1
-   cloudnative pg to v1.23.3

##### Many thanks to our contributors

-   [@&#8203;TecIntelli](https://togithub.com/TecIntelli)
-   [@&#8203;jasonumiker](https://togithub.com/jasonumiker)
- [@&#8203;Gayathri-Bluemeric](https://togithub.com/Gayathri-Bluemeric)
-   [@&#8203;DLDClodio](https://togithub.com/DLDClodio)
-   [@&#8203;stalb](https://togithub.com/stalb)
-   [@&#8203;alphayax](https://togithub.com/alphayax)
-   [@&#8203;o0th](https://togithub.com/o0th)
-   [@&#8203;ShrishtiKarkera](https://togithub.com/ShrishtiKarkera)

###
[`v1.30`](https://togithub.com/canonical/microk8s/releases/tag/v1.30):
MicroK8s 1.30 released!

[Compare
Source](https://togithub.com/canonical/microk8s/compare/v1.29...v1.30)

#### Featured in this release

##### Kubernetes 1.30 obviously

Read more at
https://kubernetes.io/blog/2024/04/17/kubernetes-v1-30-release/

##### Dqlite stability

With the help of [@&#8203;miro-balaz](https://togithub.com/miro-balaz)
we identified and patched a few issued that improve the reliability of
our default datastore in resource limiting environments.

##### Important updates

Most notably

-   containerd to v1.6.28 and runc to v.1.1.12
-   gpu-operator to v23.9.1

##### New addon

- Stunner by [@&#8203;smeng9](https://togithub.com/smeng9), a Kubernetes
media gateway for WebRTC

#### In detail

##### What's changed in detail

- Do not set --hostname-override on kube-proxy when joining a cluster by
[@&#8203;neoaggelos](https://togithub.com/neoaggelos) in
[canonical/microk8s#4360
- Use build-snaps instead of manually installing the go snap by
[@&#8203;IsaacJT](https://togithub.com/IsaacJT) in
[canonical/microk8s#4377
- Bump containerd to v1.6.28 and runc to v.1.1.12 by
[@&#8203;louiseschmidtgen](https://togithub.com/louiseschmidtgen) in
[canonical/microk8s#4398
- Fix erroneous microk8s join invocations by adding validation by
[@&#8203;skatsaounis](https://togithub.com/skatsaounis) in
[canonical/microk8s#4397

##### External contributors

- [@&#8203;IsaacJT](https://togithub.com/IsaacJT) made their first
contribution in
[canonical/microk8s#4377
- [@&#8203;skatsaounis](https://togithub.com/skatsaounis) made their
first contribution in
[canonical/microk8s#4397
- [@&#8203;miro-balaz](https://togithub.com/miro-balaz) rewrote the
dqlite list query
[canonical/k8s-dqlite#83
- [@&#8203;smeng9](https://togithub.com/smeng9) contributed a new addon
Stunner
[canonical/microk8s-community-addons#223
- [@&#8203;udit-uniyal](https://togithub.com/udit-uniyal) addressed
KubeArmor installation issue
[canonical/microk8s-community-addons#216

###
[`v1.29`](https://togithub.com/canonical/microk8s/releases/tag/v1.29):
MicroK8s v1.29 released!

[Compare
Source](https://togithub.com/canonical/microk8s/compare/v1.28...v1.29)

#### Featured in this release

##### "Quality of life" improvements

A lot of effort has gone into the datastore, DQlite. In this release we
introduced the following improvements:

- DQlite node role reassignment in case of failure domain availability
changes
-   Optional admission control to ensure performance
-   Handling the out-of-disk-space cases
- Performance improvements related to static linking of DQlite and SQL
query preparation

##### New addons by our partners and community members

- Falco: the cloud-native security tool that employs custom rules on
kernel events to provide real-time alerts
- CloudNative PG Operator: Leveraging cloud native Postgres for
Kubernetes adds speed, efficiency and protection for your infrastructure
modernization
- ngrok: Ingress Controller instantly adds connectivity, load balancing,
authentication, and observability to your services

#### Detail list of updates since last release

##### Kubernetes core services

-   Kubernetes 1.29

##### Usability Improvements

-   Improved messaging in joining nodes
- Fix the default IP shown in ‘microk8s add-node’ output when using FRR
(thanks [@&#8203;nihr23](https://togithub.com/nihr43))
- Improve connectivity check in installers, thank you
[@&#8203;smithyuk](https://togithub.com/smithyuk)
-   Handle out of low disk capacity on dqlite nodes
-   Admission control to protect from dqlite performance degradation
-   Failure domain control plain datastore rebalance
- Memory argument warning in installer, thank you
[@&#8203;eddiesimeon](https://togithub.com/eddiesimeon)

##### Addon updates

-   New addon: nvidia, allows for enabling the gpu and network operators
- New addon: Falco v3.7.1, thank you
[@&#8203;jasonumiker](https://togithub.com/jasonumiker)
- New addon: CloudNativePG, thank you
[@&#8203;sxd](https://togithub.com/sxd)
- New addon: ngrok, thank you
[@&#8203;russorat](https://togithub.com/russorat)
- Added default-class option to hostpath-storage, thank you
[@&#8203;overtfuture](https://togithub.com/overtfuture)
- Upgraded sosivio to v1.7.1, thank you
[@&#8203;DanArlowski](https://togithub.com/DanArlowski)
- Upgrade linkerd to v2.14.3, thank you
[@&#8203;balchua](https://togithub.com/balchua)
- Upgraded KWasm operator to version v0.3.0, thank you
[@&#8203;0xE282B0](https://togithub.com/0xE282B0)
- Upgrade keda to v2.12.0, thank you
[@&#8203;balchua](https://togithub.com/balchua)
-   Upgraded hostpath-storage to v1.5.0
- Upgraded MICROCKS to v1.8.0, thank you
[@&#8203;yada](https://togithub.com/yada)
- hostpath-storage option not to be set as the default storage class,
courtesy of [@&#8203;overtfuture](https://togithub.com/overtfuture)
-   Removed ondat addon from the community repository

</details>

---

### Configuration

📅 **Schedule**: Branch creation - "after 1am and before 3am every
weekday" in timezone Etc/UTC, Automerge - At any time (no schedule
defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR was generated by [Mend Renovate](https://mend.io/renovate/).
View the [repository job
log](https://developer.mend.io/github/canonical/mysql-router-k8s-operator).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOC41Ni4wIiwidXBkYXRlZEluVmVyIjoiMzguNTYuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
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.

3 participants