Skip to content

Commit 41ee598

Browse files
committed
Merge branch 'main' into release-rs-fuya-fuya-dec
2 parents 8b3fe23 + 842b54b commit 41ee598

File tree

20 files changed

+335
-114
lines changed

20 files changed

+335
-114
lines changed

content/commands/json.arrtrim/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Create two headphone products with maximum sound levels.
8888

8989
{{< highlight bash >}}
9090
redis> JSON.SET key $
91-
"[[{\"name\":\"Healthy headphones\",\"description\":\"Wireless Bluetooth headphones with noise-cancelling technology\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":99.98,\"stock\":25,\"colors\":[\"black\",\"silver\"],\"max_level\":[60,70,80]},{\"name\":\"Noisy headphones\",\"description\":\"Wireless Bluetooth headphones with noise-cancelling technology\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":99.98,\"stock\":25,\"colors\":[\"black\",\"silver\"],\"max_level\":[85,90,100,120]}]]"
91+
"[{\"name\":\"Healthy headphones\",\"description\":\"Wireless Bluetooth headphones with noise-cancelling technology\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":99.98,\"stock\":25,\"colors\":[\"black\",\"silver\"],\"max_level\":[60,70,80]},{\"name\":\"Noisy headphones\",\"description\":\"Wireless Bluetooth headphones with noise-cancelling technology\",\"connection\":{\"wireless\":true,\"type\":\"Bluetooth\"},\"price\":99.98,\"stock\":25,\"colors\":[\"black\",\"silver\"],\"max_level\":[85,90,100,120]}]"
9292
OK
9393
{{< / highlight >}}
9494

Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
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 `execute()`
37+
method on the pipeline object. This method returns a list that contains
38+
the results from all the commands in order.
39+
40+
Note that the command methods for a pipeline always return the original
41+
pipeline object, so you can "chain" several commands together, as the
42+
example below shows:
43+
44+
<!-- Tested examples will replace the inline ones when they are approved.
45+
Markup removed to stop warnings.
46+
47+
clients-example pipe_trans_tutorial basic_pipe Python
48+
/clients-example
49+
-->
50+
```python
51+
import redis
52+
53+
r = redis.Redis(decode_responses=True)
54+
55+
pipe = r.pipeline()
56+
57+
for i in range(5):
58+
pipe.set(f"seat:{i}", f"#{i}")
59+
60+
set_5_result = pipe.execute()
61+
print(set_5_result) # >>> [True, True, True, True, True]
62+
63+
pipe = r.pipeline()
64+
65+
# "Chain" pipeline commands together.
66+
get_3_result = pipe.get("seat:0").get("seat:3").get("seat:4").execute()
67+
print(get_3_result) # >>> ['#0', '#3', '#4']
68+
```
69+
70+
## Execute a transaction
71+
72+
A pipeline actually executes as a transaction by default (that is to say,
73+
all commands are executed in an uninterrupted sequence). However, if you
74+
need to switch this behavior off, you can set the `transaction` parameter
75+
to `False` when you create the pipeline:
76+
77+
```python
78+
pipe = r.pipeline(transaction=False)
79+
```
80+
81+
## Watch keys for changes
82+
83+
Redis supports *optimistic locking* to avoid inconsistent updates
84+
to different keys. The basic idea is to watch for changes to any
85+
keys that you use in a transaction while you are are processing the
86+
updates. If the watched keys do change, you must restart the updates
87+
with the latest data from the keys. See
88+
[Transactions]({{< relref "/develop/interact/transactions" >}})
89+
for more information about optimistic locking.
90+
91+
The example below shows how to repeatedly attempt a transaction with a watched
92+
key until it succeeds. The code reads a string
93+
that represents a `PATH` variable for a command shell, then appends a new
94+
command path to the string before attempting to write it back. If the watched
95+
key is modified by another client before writing, the transaction aborts
96+
with a `WatchError` exception, and the loop executes again for another attempt.
97+
Otherwise, the loop terminates successfully.
98+
99+
<!--
100+
clients-example pipe_trans_tutorial trans_watch Python
101+
/clients-example
102+
-->
103+
```python
104+
r.set("shellpath", "/usr/syscmds/")
105+
106+
with r.pipeline() as pipe:
107+
# Repeat until successful.
108+
while True:
109+
try:
110+
# Watch the key we are about to change.
111+
pipe.watch("shellpath")
112+
113+
# The pipeline executes commands directly (instead of
114+
# buffering them) from immediately after the `watch()`
115+
# call until we begin the transaction.
116+
current_path = pipe.get("shellpath")
117+
new_path = current_path + ":/usr/mycmds/"
118+
119+
# Start the transaction, which will enable buffering
120+
# again for the remaining commands.
121+
pipe.multi()
122+
123+
pipe.set("shellpath", new_path)
124+
125+
pipe.execute()
126+
127+
# The transaction succeeded, so break out of the loop.
128+
break
129+
except redis.WatchError:
130+
# The transaction failed, so continue with the next attempt.
131+
continue
132+
133+
get_path_result = r.get("shellpath")
134+
print(get_path_result) # >>> '/usr/syscmds/:/usr/mycmds/'
135+
```
136+
137+
Because this is a common pattern, the library includes a convenience
138+
method called `transaction()` that handles the code to watch keys,
139+
execute the transaction, and retry if necessary. Pass
140+
`transaction()` a function that implements your main transaction code,
141+
and also pass the keys you want to watch. The example below implements
142+
the same basic transaction as the previous example but this time
143+
using `transaction()`. Note that `transaction()` can't add the `multi()`
144+
call automatically, so you must still place this correctly in your
145+
transaction function.
146+
147+
<!--
148+
clients-example pipe_trans_tutorial watch_conv_method Python
149+
/clients-example
150+
*-->
151+
```python
152+
r.set("shellpath", "/usr/syscmds/")
153+
154+
155+
def watched_sequence(pipe):
156+
current_path = pipe.get("shellpath")
157+
new_path = current_path + ":/usr/mycmds/"
158+
159+
pipe.multi()
160+
161+
pipe.set("shellpath", new_path)
162+
163+
164+
trans_result = r.transaction(watched_sequence, "shellpath")
165+
print(trans_result) # True
166+
167+
get_path_result = r.get("shellpath")
168+
print(get_path_result) # >>> '/usr/syscmds/:/usr/mycmds/'
169+
```

content/develop/interact/search-and-query/deprecated/development.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -174,8 +174,8 @@ You can open ```redis-cli``` in another terminal to interact with it.
174174
## Running tests
175175

176176
There are several sets of unit tests:
177-
* C tests, located in ```tests/ctests```, run by ```make c_tests```.
178-
* C++ tests (enabled by GTest), located in ```tests/cpptests```, run by ```make cpp_tests```.
177+
* C tests, located in ```tests/ctests```, run by ```make c-tests```.
178+
* C++ tests (enabled by GTest), located in ```tests/cpptests```, run by ```make cpp-tests```.
179179
* Python tests (enabled by RLTest), located in ```tests/pytests```, run by ```make pytest```.
180180

181181
You can run all tests by invoking ```make test```.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
Title: Redis Insight v2.62.0, November 2024
3+
linkTitle: v2.62.0 (November 2024)
4+
date: 2024-11-27 00:00:00 +0000
5+
description: Redis Insight v2.62
6+
weight: 1
7+
8+
---
9+
## 2.62 (November 2024)
10+
This is the General Availability (GA) release of Redis Insight 2.62.
11+
12+
### Highlights
13+
- Support for multiple key name delimiters in Tree View, allowing more flexible browsing for databases with diverse key structures.
14+
- Remain authenticated to [Redis Copilot](https://redis.io/docs/latest/develop/tools/insight/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials#:~:text=for%20more%20information.-,Redis%20Copilot,-Redis%20Copilot%20is), even after reopening Redis Insight, for seamless and uninterrupted access with daily use.
15+
16+
### Details
17+
18+
**Features and improvements**
19+
- [#4090](https://github.com/RedisInsight/RedisInsight/pull/4090) Added support for multiple key name delimiters in Tree View, enabling more flexible browsing of databases with varied key name patterns.
20+
- [#3957](https://github.com/RedisInsight/RedisInsight/pull/3957) Remain authenticated to [Redis Copilot](https://redis.io/docs/latest/develop/tools/insight/?utm_source=redisinsight&utm_medium=main&utm_campaign=tutorials#:~:text=for%20more%20information.-,Redis%20Copilot,-Redis%20Copilot%20is), even after reopening Redis Insight, for seamless and uninterrupted access with daily use.
21+
- [#3988](https://github.com/RedisInsight/RedisInsight/pull/3988), [#4059](https://github.com/RedisInsight/RedisInsight/pull/4059) Enhanced both the Java and PHP serialized formatters: the Java formatter now supports date and time data, while the PHP formatter includes UTF-8 encoding for better handling of special characters and multi-language data.
22+
- [#4081](https://github.com/RedisInsight/RedisInsight/pull/4081) Introduced a unique theme key name with a proxy path prefix to prevent conflicts when multiple instances run on the same origin.
23+
- [#2970](https://github.com/RedisInsight/RedisInsight/pull/4107) Upgraded to Electron 33.2.0 for enhanced security and compatibility with modern web standards.
24+
25+
**Bugs**
26+
- [#4089](https://github.com/RedisInsight/RedisInsight/pull/4089) Resolved an issue where large integers in JSON keys were being rounded, ensuring data integrity.
27+
28+
**SHA-256 Checksums**
29+
| Package | SHA-256 |
30+
|--|--|
31+
| Windows | ibZ5kn0GSdrbnfHRWC1lDdKozn6YllcGIrDhmLEnt2K1rjgjL2kGKvbtfq9QEkumgGwk2a9zTjr0u5zztGHriQ== |
32+
| Linux AppImage | bM6lbyeAHFX/f0sBehu9a9ifHsDvX8o/2qn91sdtyiRcIU+f31+Ch7K4NI4v226rgj6LvkFDWDNq6VQ4pyLAPA== |
33+
| Linux Debian| ilD86T/+8gEgrZg8MS8Niv/8g54FPeEn1nZrUI6DA7KTl3owqzqD0npb8fdAdL6YtSRbSBUK2fXPQ6GRXWZ/GA== |
34+
| MacOS Intel | pSy3CvRfVIT3O7BXUPMUoONRaZCOA1965tF9T19gZ1NnUn9YkjWlNXdniQHZ4ALKbpC2q62ygt39xF6O52LxAw== |
35+
| MacOS Apple silicon | uoz6I6MO4/j8UJo7eNje3dz4rx1KKj6mum/vXb2882fYPD/lK1cG0Q0OZu/lbxuk0xgzXfWv0MhMTIVVV+EADg== |

content/integrate/redis-data-integration/data-pipelines/data-pipelines.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,11 @@ targets:
131131
# cert: ${TARGET_DB_CERT}
132132
# cacert: ${TARGET_DB_CACERT}
133133
# key_password: ${TARGET_DB_KEY_PASSWORD}
134+
processors:
135+
# Enable Debezium LOB placeholders for tables that contain large objects.
136+
# Uncomment this property (and the `processors:` section) if your tables include
137+
# Oracle large objects (BLOB, CLOB, NCLOB).
138+
# debezium_lob_encoded_placeholder: X19kZWJleml1bV91bmF2YWlsYWJsZV92YWx1ZQ==
134139
```
135140

136141
The main sections of the file configure [`sources`](#sources) and [`targets`](#targets).

content/integrate/redis-data-integration/data-pipelines/deploy.md

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -87,17 +87,24 @@ kubectl create secret generic source-db \
8787
--namespace=rdi \
8888
--from-literal=SOURCE_DB_PASSWORD=yourPassword
8989

90-
# Source trust certificate
90+
# Source trust certificate (both commands are required)
91+
kubectl create secret generic source-db-ssl --from-file=ca.crt=/path/to/myca.crt -n rdi
92+
9193
kubectl create secret generic source-db \
9294
--namespace=rdi \
9395
--from-literal=SOURCE_DB_CACERT=/etc/certificates/source_db/ca.crt
9496

95-
# Source public key
97+
# Source public key (both commands are required)
98+
kubectl create secret generic source-db-ssl --from-file=client.crt=/path/to/myclient.crt -n rdi
99+
96100
kubectl create secret generic source-db \
97101
--namespace=rdi \
98102
--from-literal=SOURCE_DB_CERT=/etc/certificates/source_db/client.crt
99103

100-
# Source private key
104+
105+
# Source private key (both commands are required)
106+
kubectl create secret generic source-db-ssl --from-file=client.key=/path/to/myclient.key -n rdi
107+
101108
kubectl create secret generic source-db \
102109
--namespace=rdi \
103110
--from-literal=SOURCE_DB_KEY=/etc/certificates/source_db/client.key
@@ -116,20 +123,27 @@ kubectl create secret generic target-db \
116123
--namespace=rdi \
117124
--from-literal=TARGET_DB_PASSWORD=yourPassword
118125

119-
# Target trust certificate
126+
# Target trust certificate (both commands are required)
127+
kubectl create secret generic target-db-ssl --from-file=ca.crt=/path/to/myca.crt -n rdi
128+
120129
kubectl create secret generic target-db \
121130
--namespace=rdi \
122131
--from-literal=TARGET_DB_CACERT=/etc/certificates/target-db/ca.crt
123132

124-
# Target public key
133+
# Target public key (both commands are required)
134+
kubectl create secret generic target-db-ssl --from-file=client.crt=/path/to/myclient.crt -n rdi
135+
125136
kubectl create secret generic target-db \
126137
--namespace=rdi \
127-
--from-literal=TARGET_DB_CERT=/etc/certificates/target-db/client.crt
138+
--from-literal=SOURCE_DB_CERT=/etc/certificates/target_db/client.crt
139+
140+
141+
# Target private key (both commands are required)
142+
kubectl create secret generic target-db-ssl --from-file=client.key=/path/to/myclient.key -n rdi
128143

129-
# Target private key
130144
kubectl create secret generic target-db \
131145
--namespace=rdi \
132-
--from-literal=TARGET_DB_KEY=/etc/certificates/target-db/client.key
146+
--from-literal=SOURCE_DB_KEY=/etc/certificates/target_db/client.key
133147
```
134148

135149
## Deploy a pipeline

content/integrate/redis-data-integration/installation/install-k8s.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ information. *This requires Redis Enterprise v6.4 or greater*.
6161
- Use the Redis console to create a database with 250MB RAM with one primary and one replica.
6262
- If you are deploying RDI for a production environment then secure this database with a password
6363
and [TLS](https://en.wikipedia.org/wiki/Transport_Layer_Security).
64+
- Set the database's
65+
[eviction policy]({{< relref "/operate/rs/databases/memory-performance/eviction-policy" >}}) to `noeviction` and set
66+
[data persistence]({{< relref "/operate/rs/databases/configure/database-persistence" >}})
67+
to AOF - fsync every 1 sec.
6468

6569
You should then provide the details of this database in the [`values.yaml`](#the-valuesyaml-file)
6670
file as described below.
@@ -465,6 +469,28 @@ collector-api-<id> 1/1 Running 0 29m
465469
You can verify that the RDI API works by adding the server in
466470
[Redis Insight]({{< relref "/develop/tools/insight/rdi-connector" >}}).
467471

472+
## Using ingress controllers
473+
474+
If you want to expose the RDI API service via the K8s
475+
[`Ingress`](https://kubernetes.io/docs/concepts/services-networking/ingress/)
476+
resource, you must ensure that an appropriate
477+
[ingress controller](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/) is available in your K8s cluster. Follow the documentation of your cloud provider or of
478+
the ingress controller to install the controller correctly.
479+
480+
### Using the `nginx` ingress controller on AKS
481+
482+
On AKS, if you want to use the open source
483+
[`nginx`](https://nginx.org/)
484+
[ingress controller](https://github.com/kubernetes/ingress-nginx/blob/main/README.md#readme)
485+
rather than the
486+
[AKS application routing add-on](https://learn.microsoft.com/en-us/azure/aks/app-routing),
487+
follow the AKS documentation for
488+
[creating an unmanaged ingress controller](https://learn.microsoft.com/en-us/troubleshoot/azure/azure-kubernetes/load-bal-ingress-c/create-unmanaged-ingress-controller?tabs=azure-cli).
489+
Specifically, ensure that one or both of the following Helm chart values is set:
490+
491+
- `controller.service.annotations."service\.beta\.kubernetes\.io/azure-load-balancer-health-probe-request-path"=/healthz`
492+
- `controller.service.externalTrafficPolicy=Local`
493+
468494
## Prepare your source database
469495

470496
You must also configure your source database to use the CDC connector. See the

0 commit comments

Comments
 (0)