Commit Graph

88 Commits

Author SHA1 Message Date
Josh van Leeuwen d8ac01bc76
Update go -> 1.24.1 & golangci-lint -> 1.64.6 (#3699)
Signed-off-by: joshvanl <me@joshvanl.dev>
2025-03-12 13:50:32 -07:00
Sam 1e295a7056
fix: make sure region field is required on other components (#3625)
Signed-off-by: Samantha Coyle <sam@diagrid.io>
2024-12-06 14:00:34 -08:00
Sam 72c92fb1fe
feat(postgres): add iam roles anywhere auth profile (#3604)
Signed-off-by: Samantha Coyle <sam@diagrid.io>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
2024-12-03 13:17:13 -08:00
Fabian Martinez 0f09d25bcd
postgres binding, ping on init (#3595)
Signed-off-by: Fabian Martinez <46371672+famarting@users.noreply.github.com>
2024-11-20 06:47:40 -08:00
Elena Kolevska dae321130c
Merge 1.14 into master (#3579)
Signed-off-by: Samantha Coyle <sam@diagrid.io>
Signed-off-by: Elena Kolevska <elena@kolevska.com>
Signed-off-by: yaron2 <schneider.yaron@live.com>
Signed-off-by: Artur Souza <asouza.pro@gmail.com>
Signed-off-by: Anton Troshin <anton@diagrid.io>
Co-authored-by: Sam <sam@diagrid.io>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: yaron2 <schneider.yaron@live.com>
Co-authored-by: Anton Troshin <troll.sic@gmail.com>
Co-authored-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2024-10-24 16:52:48 -07:00
Sam bf07ca5078
fix(query): duplicate key violating unique restraint (#3446)
Signed-off-by: Samantha Coyle <sam@diagrid.io>
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2024-06-26 11:08:00 -07:00
Alessandro (Ale) Segala 93cf5cb2c9
Fixups from #3324 (#3419)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2024-05-21 10:26:21 -07:00
Sam eb82293623
feat(aws iam): support aws iam auth for postgresql components (#3324)
Signed-off-by: Samantha Coyle <sam@diagrid.io>
Signed-off-by: Bernd Verst <github@bernd.dev>
Signed-off-by: joshvanl <me@joshvanl.dev>
Co-authored-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Bernd Verst <github@bernd.dev>
Co-authored-by: joshvanl <me@joshvanl.dev>
2024-05-16 15:45:57 -07:00
Sam e114060fbb
fix: create table for migration only if not exists (#3356)
Signed-off-by: Samantha Coyle <sam@diagrid.io>
2024-02-20 13:50:42 -08:00
Alessandro (Ale) Segala 94c5618f46
Improve Multi perf on SQL state stores with 1 op only (#3300)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2024-01-04 15:48:08 +00:00
Alessandro (Ale) Segala 02c6b21ec6
Postgres v2 state: handle invalid etag format (#3279)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-12-19 12:19:27 -08:00
Alessandro (Ale) Segala 73997a2b8d
PostgreSQL state store v2 (#3250)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Bernd Verst <github@bernd.dev>
2023-12-18 13:59:30 -08:00
Bernd Verst 9095b0e7e7
Switch to Go 1.21, Updates linter, updates workflows, adds sarama 1.42.1 (#3251)
Signed-off-by: Bernd Verst <github@bernd.dev>
2023-11-28 18:13:09 -08:00
Alessandro (Ale) Segala 934e86c4f7
Rename folder "internal" to "common" (#3225)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-11-14 11:36:38 -08:00
Alessandro (Ale) Segala e9911a1635
Unify SQL DB migration subsystem (for Postgres and SQLite) (#3134)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Bernd Verst <github@bernd.dev>
2023-09-20 13:42:40 -07:00
Bernd Verst 81539d0b53
Postgres components: Adds `queryExecMode` option (#3103)
Signed-off-by: Bernd Verst <github@bernd.dev>
2023-08-25 12:42:23 -07:00
Alessandro (Ale) Segala a4012953ea
Add Azure AD support to Postgres configuration store and bindings (#2971)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Alessandro (Ale) Segala <43508+ItalyPaleAle@users.noreply.github.com>
2023-07-12 15:03:18 -07:00
Alessandro (Ale) Segala 58228efd01
Add Azure AD support to Postgres state store component (#2970)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-07-06 23:38:11 -07:00
Alessandro (Ale) Segala 1f27fd0e8b
Add conformance tests for etags in Bulk operations (#2843)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Artur Souza <artursouza.ms@outlook.com>
Co-authored-by: Artur Souza <artursouza.ms@outlook.com>
2023-05-17 16:28:29 -07:00
Alessandro (Ale) Segala e30d140479
Remove native/transactional BulkSet/BulkDelete from state stores (#2834)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-05-17 14:56:34 -07:00
Tiago Alves Macambira 62a4a6f3c5
Improves metadata YAML for state.postgresql (#2798)
Signed-off-by: Tiago Alves Macambira <tmacam@burocrata.org>
2023-04-19 21:28:43 +00:00
Alessandro (Ale) Segala 5dad8a867c
Metadata parser: add support for built-in authentication profiles and metadata properties (#2760)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Bernd Verst <github@bernd.dev>
2023-04-12 00:04:34 +00:00
Alessandro (Ale) Segala 4f94da95cf
Refactor state store bulk operations (#2747)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-04-07 19:19:47 +00:00
Alessandro (Ale) Segala 029040c6a9
Fix inconsistency with TTL and Etags in SQL databases + fix SQL Server cert tests (#2688)
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Signed-off-by: Bernd Verst <github@bernd.dev>
Co-authored-by: Bernd Verst <github@bernd.dev>
2023-03-25 02:34:30 +00:00
MregXN def1dca6c2
Create component metadata for state.postgresql (#2695)
Signed-off-by: MregXN <46479059+MregXN@users.noreply.github.com>
2023-03-23 09:24:16 -07:00
Josh van Leeuwen acb4418271
Consolidate CockroachDB and PostgreSQL into single internal implementation (#2632)
Signed-off-by: joshvanl <me@joshvanl.dev>
2023-03-06 21:49:49 +00:00
Josh van Leeuwen d098e38d6a
Propagate context from caller to appropriate places in the code (#2474)
* Propagates contexts to callers where appropriate.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Updates units tests with new func signature

Signed-off-by: joshvanl <me@joshvanl.dev>

* Fix linting errors

Signed-off-by: joshvanl <me@joshvanl.dev>

* Add atomic gate to alicloud rocketmq close channel.

Signed-off-by: joshvanl <me@joshvanl.dev>

* bindings/aws/kinesis use a separate ctx variable name

Signed-off-by: joshvanl <me@joshvanl.dev>

* binding/kafka: use atomic to prevent closing the channel twice

Signed-off-by: joshvanl <me@joshvanl.dev>

* bindings/mqtt3: use atomic bool to prevent close channel being closed multiple times

Signed-off-by: joshvanl <me@joshvanl.dev>

* bindings/mqtt3: use Background context for handle operations:w

Signed-off-by: joshvanl <me@joshvanl.dev>

* state/cocroachdb: add context to Ping()

Signed-off-by: joshvanl <me@joshvanl.dev>

* bindings/postgres: add comment explaining use of context.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Adds comment header to health/pinger.go

Signed-off-by: joshvanl <me@joshvanl.dev>

* pubsub/aws/snssqs: add waitgroup to wait for all go routines to finish
and block on Close(). Shuts down the subscription if there are no topic
handlers.

Signed-off-by: joshvanl <me@joshvanl.dev>

* pubsub/mqtt3: add atomic bool to prevent multiple channel closes. Add
wait group to block close on all goroutines to finish.

Signed-off-by: joshvanl <me@joshvanl.dev>

* pubsub/rabbitmq: fixes race conditions, uses atomic to prevent multiple
closes, add wait group to block close on all goroutines

Signed-off-by: joshvanl <me@joshvanl.dev>

* pubsub/redis: revert ctx passed when it could be cancelled. Add wait
group wait when closing.

Signed-off-by: joshvanl <me@joshvanl.dev>

* state/postges: pass context in init, and wait group on close.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Update all `Ping()` to `PingContext()` where possible.

Signed-off-by: joshvanl <me@joshvanl.dev>

* state/in-memory: add atomic bool to prevent closing channel multiple
times. Add wait group to block on close()

Signed-off-by: joshvanl <me@joshvanl.dev>

* state/mysql: don't use same ctx variable name

Signed-off-by: joshvanl <me@joshvanl.dev>

* Pass correct loop context to redis go routines

Signed-off-by: joshvanl <me@joshvanl.dev>

* Rename context when creating timeouts in state

Signed-off-by: joshvanl <me@joshvanl.dev>

* Remove state.Features() from requiring a context

Signed-off-by: joshvanl <me@joshvanl.dev>

* Revert wasm request handle Close func to be without context to
implement io.Closer interface. Add 5 second timeout. Add io.Closer
assertion in test.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Remove superfluous go lint vet directive

Signed-off-by: joshvanl <me@joshvanl.dev>

* Change Configuration Init function to take context

Signed-off-by: joshvanl <me@joshvanl.dev>

* Updates input binding interface to include a `Close() error` function. `Close`
blocks until all resources have been released and go routines have returned.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Change `Close() error` in input binding struct to `io.Closer` interface.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Update go.mod files to point to dapr/dapr PR https://github.com/dapr/dapr/pull/5831

Signed-off-by: joshvanl <me@joshvanl.dev>

* pubsub/redis: watch closeCh to shutdown worker instead of init context.

Signed-off-by: joshvanl <me@joshvanl.dev>

* pubsub/aws/snssqs + bindings/kubemq: ensure closeCh is caught so Close
correctly returns

Signed-off-by: joshvanl <me@joshvanl.dev>

* Close kubemq binding client on close. Ensure kafka consumer channel
cannot be closed more than once.

Signed-off-by: joshvanl <me@joshvanl.dev>

* Tweaks

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* Fixed cert tests

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>

* binding/mqtt3: add inline Background context instead of passing to
handleMessage

Signed-off-by: joshvanl <me@joshvanl.dev>

* pubsub/mqtt3: remove context from createSubscriberClientOptions

Signed-off-by: joshvanl <me@joshvanl.dev>

* pubsub/mqtt3: Remove `ResetConnection` func

Signed-off-by: joshvanl <me@joshvanl.dev>

* pubsub/kafka: Don't resubscribe if Subscribe is cancelled.

Signed-off-by: joshvanl <me@joshvanl.dev>

* binding/mqtt3: don't use context to control establishing connection

Signed-off-by: joshvanl <me@joshvanl.dev>

* bindings/mqtt3: Fix linting errors

Signed-off-by: joshvanl <me@joshvanl.dev>

---------

Signed-off-by: joshvanl <me@joshvanl.dev>
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
2023-02-16 14:18:35 -08:00
ItalyPaleAle 89720a909d Fixes
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-02-03 22:31:23 +00:00
ItalyPaleAle 42d7309244 Concurrency control for TTL cleanup
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-02-03 21:53:50 +00:00
ItalyPaleAle 6f71753c13 New SQLite 3 state store
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2023-01-24 17:39:11 -08:00
ItalyPaleAle b42e70606c 💄
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-12-22 23:38:55 +00:00
ItalyPaleAle b70a17ed59 DRY
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-12-22 19:53:27 +00:00
ItalyPaleAle 8a58434660 Make timeout configurable
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-12-22 19:49:20 +00:00
ItalyPaleAle 80b1bb14b7 Changed postgres state store to use pgx instead of db/sql
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-12-20 22:45:38 +00:00
ItalyPaleAle b1cc54f62c Merge branch 'master' of https://github.com/dapr/components-contrib into postgres-ttl
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-12-13 21:16:57 +00:00
1046102779 2dd7433a59 feature: add context to state API
Signed-off-by: 1046102779 <seachen@tencent.com>
2022-12-08 15:56:51 +08:00
ItalyPaleAle f718462d23 💄
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-12-06 01:30:29 +00:00
ItalyPaleAle 413ee92d88 We don't need locks when we do things atomically
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-12-06 01:27:17 +00:00
ItalyPaleAle 64a70c230c Fixed handling of concurrent background cleanups and added cert tests
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-12-06 01:24:22 +00:00
ItalyPaleAle d4dcc54e29 Improved concurrency handling for migrations
And added cert test for that

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-12-05 21:00:31 +00:00
ItalyPaleAle 0b340d11d3 Cleanup interval uses metadata table to avoid multiple executions simultaneously
Also bug fixes

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-12-01 19:31:23 +00:00
ItalyPaleAle b52482b394 Use a metadata table for postgres to store migrations
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-30 23:02:58 +00:00
ItalyPaleAle 15976110c6 💄
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-22 04:53:24 +00:00
ItalyPaleAle 1c3a0a1ea2 Fixed query
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-22 03:22:54 +00:00
ItalyPaleAle 2e7d5e7df6 Added garbage collection
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-22 02:05:07 +00:00
ItalyPaleAle c54286a60d Added TTL support for postgres
TODO: garbage collection
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-22 00:24:04 +00:00
ItalyPaleAle ca729de1a9 Add expiredate column to state table
Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-21 23:22:57 +00:00
ItalyPaleAle 1e728597b4 Misc refactorings
- Removed `state.DeleteWithOptions` and `state.SetWithOptions` which were useless at this point (likely a leftover from when there were retries)
- Some improvements in etag handling in postgres
- Other minor refactorings

Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
2022-11-17 16:29:29 +00:00
Bernd Verst b7d56fd7d6 Postgresql: allow custom table table
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-11-16 20:13:57 -08:00
Bernd Verst 3af0953516 Postgres State Store: Add Support for First-Write concurrency
Signed-off-by: Bernd Verst <4535280+berndverst@users.noreply.github.com>
2022-11-16 20:13:57 -08:00