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: removing goroutine-based TTL expiry model #221

Closed
wants to merge 46 commits into from

Conversation

gshilei
Copy link
Contributor

@gshilei gshilei commented Oct 18, 2023

Hi @brandond,

According to your suggestion,I introduce the delaying work-queue to fix the "goroutine-based TTL expiry model" issue and the "watch channel of ttl events maybe abnormally closed" issue by the way. Please help to review it. if it make sense, then PR #218 can be closed in the future.

Related Issue:

In order to make the commit cleaner, please refer to new pr #235

@gshilei gshilei requested a review from a team as a code owner October 18, 2023 04:26
@gshilei gshilei changed the title refactor: import work queue to handle ttl events refactor: removing goroutine-based TTL expiry model Oct 18, 2023
pkg/logstructured/logstructured.go Outdated Show resolved Hide resolved
pkg/logstructured/logstructured.go Outdated Show resolved Hide resolved
pkg/logstructured/logstructured.go Outdated Show resolved Hide resolved
pkg/logstructured/logstructured.go Outdated Show resolved Hide resolved
pkg/logstructured/logstructured.go Outdated Show resolved Hide resolved
pkg/logstructured/logstructured.go Outdated Show resolved Hide resolved
pkg/logstructured/logstructured.go Outdated Show resolved Hide resolved
Copy link
Member

@brandond brandond left a comment

Choose a reason for hiding this comment

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

Final nit. lgtm otherwise. thanks for talking through it with me!

pkg/logstructured/logstructured.go Outdated Show resolved Hide resolved
@gshilei
Copy link
Contributor Author

gshilei commented Oct 20, 2023

Final nit. lgtm otherwise. thanks for talking through it with me!

Thank you very much for your more professional attitude towards this review, Best wishes to you.

pkg/logstructured/logstructured.go Outdated Show resolved Hide resolved
pkg/logstructured/logstructured.go Outdated Show resolved Hide resolved
pkg/logstructured/logstructured.go Outdated Show resolved Hide resolved
pkg/logstructured/logstructured.go Outdated Show resolved Hide resolved
pkg/logstructured/logstructured.go Outdated Show resolved Hide resolved
pkg/logstructured/logstructured.go Show resolved Hide resolved
pkg/logstructured/logstructured.go Show resolved Hide resolved
@gshilei gshilei requested a review from brandond October 27, 2023 17:16
@gshilei
Copy link
Contributor Author

gshilei commented Oct 30, 2023

Hi @brandond,

Do you have any other suggestions for this PR? In addition, I found "continuous-integration/drone/pr build" was killed abnormally. How can I trigger it again?

@gshilei gshilei requested a review from brandond October 30, 2023 02:11
Copy link
Member

@brandond brandond left a comment

Choose a reason for hiding this comment

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

One nit on a comment that can be removed.

Can you rebase and squash this? Once that's set I think we're good.

@@ -256,66 +268,164 @@ func (l *LogStructured) Update(ctx context.Context, key string, value []byte, re
return rev, updateEvent.KV, true, err
}

func (l *LogStructured) ttl(ctx context.Context) {
// vary naive TTL support
Copy link
Member

Choose a reason for hiding this comment

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

you can drop this comment now, I think ;)

macedogm and others added 17 commits October 31, 2023 10:31
Signed-off-by: Guilherme Macedo <guilherme.macedo@suse.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Guilherme Macedo <guilherme.macedo@suse.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Matt Trachier <matttrach@gmail.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Matt Trachier <matttrach@gmail.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Matt Trachier <matttrach@gmail.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: DerEnderKeks <derenderkeks@gmail.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Matt Trachier <matttrach@gmail.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
* Add support for an embedded NATS server
* Put embedded server behind build flag
   Rename various identifiers to NATS rather than JetStream, which is a subsystem of NATS.
* Refactoring
* Update NATS versions and add embedded test
* Add nats build tag for tests
* Support embedded socket connection
* Update to NATS v2.9.16
* Remove unused variables
* Add backend "jetstream://" URI support
* Remove override of port
* Add examples doc
* Remove IP and port
* Fix whitespace
* Default to embedded it available
   Fix log line for embedded.
* Change to use noEmbed to disable embedding
* Fix test script and update to 2.9.16

Signed-off-by: Byron Ruth <byron@nats.io>
Co-authored-by: Brad Davidson <brad@oatmail.org>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
* chore: Updated the content of the file "/tmp/updatecli/github/k3s-io/kine/Dockerfile.dapper"

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Bumps [github.com/rancher/wrangler](https://github.com/rancher/wrangler) from 0.8.3 to 0.8.5.
- [Release notes](https://github.com/rancher/wrangler/releases)
- [Commits](rancher/wrangler@v0.8.3...v0.8.5)

---
updated-dependencies:
- dependency-name: github.com/rancher/wrangler
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Existing deployments using this scheme will effectively ignore the
embedded server options.

Signed-off-by: Byron Ruth <byron@nats.io>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Matt Trachier <matttrach@gmail.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Vitor Savian <vitor.savian@suse.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Bumps alpine from 3.17 to 3.18.

---
updated-dependencies:
- dependency-name: alpine
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Bruno Bigras <bigras.bruno@gmail.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
* Update NATS to v2.9.18
* Update test-run-nats to 2.9.18

Signed-off-by: Byron Ruth <byron@nats.io>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
* chore: Updated to content "" in file "Dockerfile.dapper"

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
brandond and others added 27 commits October 31, 2023 10:31
Updates mysql=v1.2.7, pgx=v5.4.2, go-sqlite3=v1.14.17/sqlite=3.42.0, etcd=v3.5.9

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
* chore: Updated to content "" in file "Dockerfile.dapper"
* chore: Updated to content "" in file "Dockerfile.dapper"

Made with ❤️️ by updatecli

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Because it will cause memory leak if we do not stop ticker when the function has completed.

Signed-off-by: hang.jiang <hang.jiang@daocloud.io>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Under stress, concurrent operations (notably while garbage collection is in progress) can result in failed calls with error SQLITE_BUSY (database is locked).

The SQLITE_BUSY result code is an expected outcome when the database file could not be written (or in some cases read) because of concurrent activity: https://www.sqlite.org/rescode.html

SQLite ships a busy timeout retry mechanism as a PRAGMA (https://www.sqlite.org/pragma.html#pragma_busy_timeout), that can be set via go-sqlite3's connection string.

That makes go-sqlite3 retry operations that fail with SQLITE_BUSY transparently to users.

Fixes k3s-io/k3s#8234

Signed-off-by: Silvio Moioli <silvio@moioli.net>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Add CODEOWNERS, MAINTAINERS and enable DCO.

Signed-off-by: Caroline Davis <caroline.davis@suse.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Bumps golang from 1.20-alpine3.17 to 1.21-alpine3.17.

---
updated-dependencies:
- dependency-name: golang
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
* chore: Updated to content "" in file "Dockerfile.dapper"

Made with ❤️️ by updatecli

Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: guoguangwu <guoguangwu@magic-shield.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Bumps [actions/checkout](https://github.com/actions/checkout) from 3 to 4.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](actions/checkout@v3...v4)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
* Remove dapper from testing
* Bump default k3s used for testing
* Update mysql and postgres versions to test

Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Upstream etcd has seen issues with grpc muxed with http and recommends against it. Ref: etcd-io/etcd#15402

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
…was closed

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Also, return proper GPRC errors to improve client handling.

Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Brad Davidson <brad.davidson@rancher.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Bumps [google.golang.org/grpc](https://github.com/grpc/grpc-go) from 1.53.0 to 1.56.3.
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](grpc/grpc-go@v1.53.0...v1.56.3)

---
updated-dependencies:
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.10.0 to 0.17.0.
- [Commits](golang/net@v0.10.0...v0.17.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
* Remove dapper from testing
* Bump default k3s used for testing
* Update mysql and postgres versions to test

Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.com>
Signed-off-by: Derek Nola <derek.nola@suse.com>
Signed-off-by: zhiyuan <guoshilei.gsl@antgroup.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.