Skip to content

Commit 13f251d

Browse files
committed
Merge branch 'main' into DOC-4728
2 parents 1bb5dfd + cbaa680 commit 13f251d

File tree

76 files changed

+1426
-76
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1426
-76
lines changed

.github/workflows/k8s_apis_sync.yaml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -90,30 +90,30 @@ jobs:
9090
EOL
9191
}
9292
93-
formatYamlSnippet admission-service.yaml content/embeds/admission-service.md
94-
formatYamlSnippet admission/webhook.yaml content/embeds/admission_webhook.md
95-
formatYamlSnippet examples/v1/rec.yaml content/embeds/rec.md
96-
formatYamlSnippet examples/v1alpha1/reaadb.yaml content/embeds/reaadb.md
97-
formatYamlSnippet examples/v1alpha1/redb.yaml content/embeds/redb.md
98-
formatYamlSnippet examples/v1alpha1/rerc.yaml content/embeds/rerc.md
99-
formatYamlSnippet log_collector/log_collector_role_all_mode.yaml content/embeds/log_collector_role_all_mode.md
100-
formatYamlSnippet log_collector/log_collector_role_restricted_mode.yaml content/embeds/log_collector_role_restricted_mode.md
101-
formatYamlSnippet multi-namespace-redb/operator_cluster_role_binding.yaml content/embeds/multi-ns_operator_cluster_role_binding.md
102-
formatYamlSnippet multi-namespace-redb/operator_cluster_role.yaml content/embeds/multi-ns_operator_cluster_role.md
103-
formatYamlSnippet multi-namespace-redb/role_binding.yaml content/embeds/multi-ns_role_binding.md
104-
formatYamlSnippet multi-namespace-redb/role.yaml content/embeds/multi-ns_role.md
105-
formatYamlSnippet openshift/admission-service.yaml content/embeds/openshift_admission-service.md
106-
formatYamlSnippet openshift/rec_rhel.yaml content/embeds/openshift_rec.md
107-
formatYamlSnippet openshift/role_binding.yaml content/embeds/openshift_role_binding.md
108-
formatYamlSnippet openshift/role.yaml content/embeds/openshift_role.md
109-
formatYamlSnippet openshift/scc.yaml content/embeds/openshift_scc.md
110-
formatYamlSnippet openshift/service_account.yaml content/embeds/openshift_service_account.md
111-
formatYamlSnippet rack_awareness/rack_aware_cluster_role_binding.yaml content/embeds/rack_aware_cluster_role_binding.md
112-
formatYamlSnippet rack_awareness/rack_aware_cluster_role.yaml content/embeds/rack_aware_cluster_role.md
113-
formatYamlSnippet rack_awareness/rack_aware_rec.yaml content/embeds/rack_aware_rec.md
114-
formatYamlSnippet role_binding.yaml content/embeds/role_binding.md
115-
formatYamlSnippet role.yaml content/embeds/role.md
116-
formatYamlSnippet service_account.yaml content/embeds/service_account.md
93+
formatYamlSnippet admission-service.yaml content/embeds/k8s/admission-service.md
94+
formatYamlSnippet admission/webhook.yaml content/embeds/k8s/admission_webhook.md
95+
formatYamlSnippet examples/v1/rec.yaml content/embeds/k8s/rec.md
96+
formatYamlSnippet examples/v1alpha1/reaadb.yaml content/embeds/k8s/reaadb.md
97+
formatYamlSnippet examples/v1alpha1/redb.yaml content/embeds/k8s/redb.md
98+
formatYamlSnippet examples/v1alpha1/rerc.yaml content/embeds/k8s/rerc.md
99+
formatYamlSnippet log_collector/log_collector_role_all_mode.yaml content/embeds/k8s/log_collector_role_all_mode.md
100+
formatYamlSnippet log_collector/log_collector_role_restricted_mode.yaml content/embeds/k8s/log_collector_role_restricted_mode.md
101+
formatYamlSnippet multi-namespace-redb/operator_cluster_role_binding.yaml content/embeds/k8s/multi-ns_operator_cluster_role_binding.md
102+
formatYamlSnippet multi-namespace-redb/operator_cluster_role.yaml content/embeds/k8s/multi-ns_operator_cluster_role.md
103+
formatYamlSnippet multi-namespace-redb/role_binding.yaml content/embeds/k8s/multi-ns_role_binding.md
104+
formatYamlSnippet multi-namespace-redb/role.yaml content/embeds/k8s/multi-ns_role.md
105+
formatYamlSnippet openshift/admission-service.yaml content/embeds/k8s/openshift_admission-service.md
106+
formatYamlSnippet openshift/rec_rhel.yaml content/embeds/k8s/openshift_rec.md
107+
formatYamlSnippet openshift/role_binding.yaml content/embeds/k8s/openshift_role_binding.md
108+
formatYamlSnippet openshift/role.yaml content/embeds/k8s/openshift_role.md
109+
formatYamlSnippet openshift/scc.yaml content/embeds/k8s/openshift_scc.md
110+
formatYamlSnippet openshift/service_account.yaml content/embeds/k8s/openshift_service_account.md
111+
formatYamlSnippet rack_awareness/rack_aware_cluster_role_binding.yaml content/embeds/k8s/rack_aware_cluster_role_binding.md
112+
formatYamlSnippet rack_awareness/rack_aware_cluster_role.yaml content/embeds/k8s/rack_aware_cluster_role.md
113+
formatYamlSnippet rack_awareness/rack_aware_rec.yaml content/embeds/k8s/rack_aware_rec.md
114+
formatYamlSnippet role_binding.yaml content/embeds/k8s/role_binding.md
115+
formatYamlSnippet role.yaml content/embeds/k8s/role.md
116+
formatYamlSnippet service_account.yaml content/embeds/k8s/service_account.md
117117
118118
- name: 'Send pull request'
119119
env:
@@ -136,7 +136,7 @@ jobs:
136136
git apply content/operate/kubernetes/reference/kubernetes-api-reference-frontmatter.patch
137137
138138
git add content/operate/kubernetes/reference/
139-
git add content/embeds/
139+
git add content/embeds/k8s/
140140
141141
git commit -m "k8s api docs ${RELEASE}"
142142
git push origin "${BRANCH}"

config.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ rdi_redis_gears_version = "1.2.6"
5555
rdi_debezium_server_version = "2.3.0.Final"
5656
rdi_db_types = "cassandra|mysql|oracle|postgresql|sqlserver"
5757
rdi_cli_latest = "latest"
58+
rdi_current_version = "v1.4.4"
5859

5960
[params.clientsConfig]
6061
"Python"={quickstartSlug="redis-py"}

content/commands/incr/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ value greater than 10, otherwise it will expire and start again from 0.
177177
If for some reason the client performs the `INCR` command but does not perform
178178
the [`EXPIRE`]({{< relref "/commands/expire" >}}) the key will be leaked until we'll see the same IP address again.
179179

180-
This can be fixed easily turning the `INCR` with optional [`EXPIRE`]({{< relref "/commands/expire" >}}) into a Lua
181-
script that is send using the [`EVAL`]({{< relref "/commands/eval" >}}) command (only available since Redis version
180+
This can be easily fixed by turning the `INCR` with optional [`EXPIRE`]({{< relref "/commands/expire" >}}) into a Lua
181+
script that is then sent using the [`EVAL`]({{< relref "/commands/eval" >}}) command (only available since Redis version
182182
2.6).
183183

184184
```

content/commands/json.set/index.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ sets the key only if it already exists.
7979

8080
## Return value
8181

82-
JSET.SET returns a simple string reply: `OK` if executed correctly or `nil` if the specified `NX` or `XX` conditions were not met.
82+
Returns one of these replies:
83+
- A simple string reply: `OK` if executed correctly
84+
- `nil`
85+
- if `key` exists but `path` does not exist and cannot be created
86+
- if an `NX` or `XX` condition is unmet
87+
- error if `key` does not exist and `path` is not root (`.` or `$`)
88+
8389
For more information about replies, see [Redis serialization protocol specification]({{< relref "/develop/reference/protocol-spec" >}}).
8490

8591
## Examples
@@ -123,6 +129,38 @@ redis> JSON.GET doc
123129
{{< / highlight >}}
124130
</details>
125131

132+
<details open>
133+
<summary><b>path does not exist and cannot be created</b></summary>
134+
135+
{{< highlight bash >}}
136+
redis> JSON.SET doc $ 1
137+
OK
138+
redis> JSON.SET doc $.x.y 2
139+
(nil)
140+
{{< / highlight >}}
141+
</details>
142+
143+
<details open>
144+
<summary><b>XX condition unmet</b></summary>
145+
146+
{{< highlight bash >}}
147+
redis> JSON.SET nonexistentkey $ 5 XX
148+
(nil)
149+
redis> JSON.GET nonexistentkey
150+
(nil)
151+
{{< / highlight >}}
152+
</details>
153+
154+
<details open>
155+
<summary><b>key does not exist and path is not root</b></summary>
156+
157+
{{< highlight bash >}}
158+
redis> JSON.SET nonexistentkey $.x 5
159+
(error) ERR new objects must be created at the root
160+
{{< / highlight >}}
161+
</details>
162+
163+
126164
## See also
127165

128166
[`JSON.GET`]({{< baseurl >}}/commands/json.get/) | [`JSON.MGET`]({{< baseurl >}}/commands/json.mget/)

content/develop/clients/_index.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ Redis does not document directly:
4747
| Language | Client name | Github | Docs |
4848
| :-- | :-- | :-- | :-- |
4949
| C | hiredis | https://github.com/redis/hiredis | https://github.com/redis/hiredis |
50+
| [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Boost.Redis | https://github.com/boostorg/redis | https://www.boost.org/doc/libs/develop/libs/redis/doc/html/index.html |
51+
| [Dart](https://dart.dev/) | redis_dart_link | https://github.com/toolsetlink/redis_dart_link | https://pub.dev/documentation/redis/latest/ |
5052
| [PHP](https://www.php.net/) | PhpRedis extension | https://github.com/phpredis/phpredis | https://github.com/phpredis/phpredis/blob/develop/README.md |
5153
| [Ruby](https://www.ruby-lang.org/en/) | redis-rb | https://github.com/redis/redis-rb | https://rubydoc.info/gems/redis |
5254
| [Rust](https://www.rust-lang.org/) | redis-rs | https://github.com/redis-rs/redis-rs | https://docs.rs/redis/latest/redis/ |
53-
| [C++](https://en.wikipedia.org/wiki/C%2B%2B) | Boost.Redis | https://github.com/boostorg/redis | https://www.boost.org/doc/libs/develop/libs/redis/doc/html/index.html |
55+
5456

5557
## Requirements
5658

content/develop/clients/client-side-caching.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,9 @@ All read-only commands (with the `@read`
8888
[ACL category]({{< relref "/operate/oss_and_stack/management/security/acl" >}}))
8989
will use cached data, except for the following:
9090

91-
- Any commands for
92-
[probabilistic data types]({{< relref "/develop/data-types/probabilistic" >}}).
91+
- Any commands for the
92+
[probabilistic]({{< relref "/develop/data-types/probabilistic" >}}) and
93+
[time series]({{< relref "/develop/data-types/timeseries" >}}) data types.
9394
These types are designed to be updated frequently, which means that caching
9495
has little or no benefit.
9596
- Non-deterministic commands such as [`HRANDFIELD`]({{< relref "/commands/hrandfield" >}}),
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
categories:
3+
- docs
4+
- develop
5+
- stack
6+
- oss
7+
- rs
8+
- rc
9+
- oss
10+
- kubernetes
11+
- clients
12+
description: Learn how to use Redis pipelines and transactions
13+
linkTitle: Pipelines/transactions
14+
title: Pipelines and transactions
15+
weight: 2
16+
---
17+
18+
Redis lets you send a sequence of commands to the server together in a batch.
19+
There are two types of batch that you can use:
20+
21+
- **Pipelines** avoid network and processing overhead by sending several commands
22+
to the server together in a single communication. The server then sends back
23+
a single communication with all the responses. See the
24+
[Pipelining]({{< relref "/develop/use/pipelining" >}}) page for more
25+
information.
26+
- **Transactions** guarantee that all the included commands will execute
27+
to completion without being interrupted by commands from other clients.
28+
See the [Transactions]({{< relref "/develop/interact/transactions" >}})
29+
page for more information.
30+
31+
## Execute a pipeline
32+
33+
To execute commands in a pipeline, you first create a pipeline object
34+
and then add commands to it using methods that resemble the standard
35+
command methods (for example, `Set()` and `Get()`). The commands are
36+
buffered in the pipeline and only execute when you call the `Exec()`
37+
method on the pipeline object.
38+
39+
The main difference with the pipeline commands is that their return
40+
values contain a valid result only after the pipeline has finished executing.
41+
You can access the result using the `Val()` method instead of
42+
`Result()` (note that errors are reported by the `Exec()` method rather
43+
than by the individual commands).
44+
45+
{{< clients-example pipe_trans_tutorial basic_pipe Go >}}
46+
{{< /clients-example >}}
47+
48+
You can also create a pipeline using the `Pipelined()` method.
49+
This executes pipeline commands in a callback function that you
50+
provide and calls `Exec()` automatically after it returns:
51+
52+
{{< clients-example pipe_trans_tutorial basic_pipe_pipelined Go >}}
53+
{{< /clients-example >}}
54+
55+
## Execute a transaction
56+
57+
A transaction works in a similar way to a pipeline. Create a
58+
transaction object with the `TxPipeline()` method, call command methods
59+
on that object, and then call the transaction object's
60+
`Exec()` method to execute it. You can access the results
61+
from commands in the transaction after it completes using the
62+
`Val()` method.
63+
64+
{{< clients-example pipe_trans_tutorial basic_trans Go >}}
65+
{{< /clients-example >}}
66+
67+
There is also a `TxPipelined()` method that works in a similar way
68+
to `Pipelined()`, described above:
69+
70+
{{< clients-example pipe_trans_tutorial basic_trans_txpipelined Go >}}
71+
{{< /clients-example >}}
72+
73+
## Watch keys for changes
74+
75+
Redis supports *optimistic locking* to avoid inconsistent updates
76+
to different keys. The basic idea is to watch for changes to any
77+
keys that you use in a transaction while you are are processing the
78+
updates. If the watched keys do change, you must restart the updates
79+
with the latest data from the keys. See
80+
[Transactions]({{< relref "/develop/interact/transactions" >}})
81+
for more information about optimistic locking.
82+
83+
The code below reads a string
84+
that represents a `PATH` variable for a command shell, then appends a new
85+
command path to the string before attempting to write it back. If the watched
86+
key is modified by another client before writing, the transaction aborts.
87+
The `Watch()` method receives a callback function where you execute the
88+
commands you want to watch. In the body of this callback, you can execute
89+
read-only commands before the transaction using the usual client object
90+
(called `rdb` in our examples) and receive an immediate result. Start the
91+
transaction itself by calling `TxPipeline()` or `TxPipelined()` on the
92+
`Tx` object passed to the callback. `Watch()` also receives one or more
93+
`string` parameters after the callback that represent the keys you want
94+
to watch.
95+
96+
For production usage, you would generally call code like the following in
97+
a loop to retry it until it succeeds or else report or log the failure:
98+
99+
{{< clients-example pipe_trans_tutorial trans_watch Go >}}
100+
{{< /clients-example >}}

content/develop/clients/jedis/transpipe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ result using the `Response` object's `get()` method.
4848
## Execute a transaction
4949

5050
A transaction works in a similar way to a pipeline. Create a
51-
transaction object with the `multi()`, call command methods
51+
transaction object with the `multi()` command, call command methods
5252
on that object, and then call the transaction object's
5353
`exec()` method to execute it. You can access the results
5454
from commands in the transaction using `Response` objects, as

content/develop/get-started/data-store.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,4 +95,8 @@ SCAN 0 MATCH "bike:*" COUNT 100
9595
You can address more use cases with Redis by learning about Redis Stack. Here are two additional quick start guides:
9696

9797
* [Redis as a document database]({{< relref "/develop/get-started/document-database" >}})
98-
* [Redis as a vector database]({{< relref "/develop/get-started/vector-database" >}})
98+
* [Redis as a vector database]({{< relref "/develop/get-started/vector-database" >}})
99+
100+
## Continue learning with Redis University
101+
102+
See the [Get Started with Redis learning path](https://university.redis.io/learningpath/14q8m6gilfwltm) for courses.

content/develop/get-started/document-database.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,7 @@ Please see the [query documentation]({{< relref "/develop/interact/search-and-qu
176176
You can learn more about how to use Redis Stack as a vector database in the following quick start guide:
177177

178178
* [Redis as a vector database]({{< relref "/develop/get-started/vector-database" >}})
179+
180+
## Continue learning with Redis University
181+
182+
See the [Get Started with Redis learning path](https://university.redis.io/learningpath/14q8m6gilfwltm) for courses.

0 commit comments

Comments
 (0)