Skip to content

Commit 9dfd01e

Browse files
committed
Merge branch 'main' into release-rs-aug
2 parents a79e060 + 321564c commit 9dfd01e

File tree

223 files changed

+1794
-1055
lines changed

Some content is hidden

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

223 files changed

+1794
-1055
lines changed

.github/workflows/main-staging.yml

Lines changed: 80 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,92 @@ jobs:
3333
echo "ERROR: Invalid branch name ${{ github.ref_name }}!"
3434
exit 1
3535
fi
36-
- name: Configure Hugo
36+
37+
- name: Install dependencies
38+
run: make deps
39+
40+
- name: Build out all versions
3741
run: |
42+
set -x
43+
44+
function setBaseUrl() {
3845
if [[ "${{ github.ref_name }}" == "main" ]]
3946
then
4047
hugo_root_path=docs/staging/dev
4148
elif [[ "${{ github.ref_name }}" == "latest" ]]
4249
then
43-
hugo_root_path="docs/latest"
50+
hugo_root_path="docs/latest"
4451
elif [[ "${{ endsWith(github.ref_name, '-build') }}" == "true" ]]
4552
then
4653
hugo_root_path=`echo docs/version/${{ github.ref_name }} | sed 's/-build$//'`
4754
else
4855
hugo_root_path=docs/staging/${{ github.ref_name }}
4956
fi \
5057
&& sed -i "s#baseURL = \"https://redis.io\"#baseURL = \"https://redis.io/$hugo_root_path\"#g" config.toml
51-
- name: Install dependencies and run Hugo
52-
run: make all
58+
}
59+
60+
setBaseUrl
61+
kubernetes_versions=($(find content/operate/kubernetes/ -maxdepth 1 -type d -regex ".*[0-9-]" | awk -F/ '{print $NF}'))
62+
rs_versions=($(find content/operate/rs/ -maxdepth 1 -type d -regex ".*[0-9-]" | awk -F/ '{print $NF}'))
63+
64+
# build latest
65+
for version in "${kubernetes_versions[@]}"; do
66+
rm -r "content/operate/kubernetes/${version}"
67+
done
68+
for version in "${rs_versions[@]}"; do
69+
rm -r "content/operate/rs/${version}"
70+
done
71+
make all
72+
73+
git checkout .
74+
75+
# build all versions
76+
for version in "${kubernetes_versions[@]}"; do
77+
78+
setBaseUrl
79+
80+
# for each version, remove all other versions before building
81+
versions_to_remove=($(echo "${kubernetes_versions[@]}" "${version}" | tr ' ' '\n' | sort | uniq -u))
82+
for version_to_remove in "${versions_to_remove[@]}"; do
83+
rm -r "content/operate/kubernetes/${version_to_remove}"
84+
done
85+
86+
cp -r "content/operate/kubernetes/${version}"/* content/operate/kubernetes/
87+
rm -r "content/operate/kubernetes/${version}"
88+
sed -i 's/id="versionSelectorKubernetesValue" class="version-selector-control">latest/id="versionSelectorKubernetesValue" class="version-selector-control">v'"${version}"'/' layouts/partials/docs-nav.html
89+
sed -i 's/linkTitle: '"${version}"'/linkTitle: Redis for Kubernetes/' content/operate/kubernetes/_index.md
90+
91+
# inject replace command in meta-links to make sure editURL and issuesURL point to right version
92+
sed -i "11i \{\{ \$gh_file = replaceRE \`\^operate\/kubernetes\/\` \"operate\/kubernetes\/$version\/\" \$gh_file }}" layouts/partials/meta-links.html
93+
94+
hugo -d "kubernetes-${version}"
95+
96+
git checkout .
97+
done
98+
99+
for version in "${rs_versions[@]}"; do
100+
101+
setBaseUrl
102+
103+
# for each version, remove all other versions before building
104+
versions_to_remove=($(echo "${rs_versions[@]}" "${version}" | tr ' ' '\n' | sort | uniq -u))
105+
for version_to_remove in "${versions_to_remove[@]}"; do
106+
rm -r "content/operate/rs/${version_to_remove}"
107+
done
108+
109+
cp -r "content/operate/rs/${version}"/* content/operate/rs/
110+
rm -r "content/operate/rs/${version}"
111+
sed -i 's/id="versionSelectorRsValue" class="version-selector-control">latest/id="versionSelectorRsValue" class="version-selector-control">v'"${version}"'/' layouts/partials/docs-nav.html
112+
sed -i 's/linkTitle: '"${version}"'/linkTitle: Redis Software/' content/operate/rs/_index.md
113+
114+
# inject replace command in meta-links to make sure editURL and issuesURL point to right version
115+
sed -i "11i \{\{ \$gh_file = replaceRE \`\^operate\/rs\/\` \"operate\/rs\/$version\/\" \$gh_file }}" layouts/partials/meta-links.html
116+
117+
hugo -d "rs-${version}"
118+
119+
git checkout .
120+
done
121+
53122
- name: List client examples
54123
run: ls "${{ github.workspace }}/examples"
55124
- name: List files to be published
@@ -80,5 +149,12 @@ jobs:
80149
bucket_path=staging/${{ github.ref_name }}
81150
fi \
82151
&& ./google-cloud-sdk/bin/gsutil -m rsync -r -c -j html -d ${{ github.workspace }}/public gs://$BUCKET/$bucket_path
152+
153+
versioned_builds=($(find . -type d -regex ".*[0-9-]" -maxdepth 1 | sed -E 's/^.\///'))
154+
for versioned_build in "${versioned_builds[@]}"; do
155+
product=$(grep -Eo '[a-zA-Z]+' <<< $versioned_build)
156+
gsutil -m rsync -r -c -j html -d "${{ github.workspace }}/${versioned_build}/operate/${product}" "gs://${BUCKET}/${versioned_build}/operate/${product}"
157+
done
158+
83159
- name: End
84160
run: echo "This job's status is ${{ job.status }}."

content/commands/del/index.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,17 @@ A key is ignored if it does not exist.
5757

5858
## Examples
5959

60+
{{< clients-example cmds_generic del >}}
61+
> SET key1 "Hello"
62+
"OK"
63+
> SET key2 "World"
64+
"OK"
65+
> DEL key1 key2 key3
66+
(integer) 2
67+
{{< /clients-example >}}
68+
69+
Give these commands a try in the interactive console:
70+
6071
{{% redis-cli %}}
6172
SET key1 "Hello"
6273
SET key2 "World"

content/commands/expire/index.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,29 @@ are now fixed.
137137

138138
## Examples
139139

140+
{{< clients-example cmds_generic expire >}}
141+
> SET mykey "Hello"
142+
"OK"
143+
> EXPIRE mykey 10
144+
(integer) 1
145+
> TTL mykey
146+
(integer) 10
147+
> SET mykey "Hello World"
148+
"OK"
149+
> TTL mykey
150+
(integer) -1
151+
> EXPIRE mykey 10 XX
152+
(integer) 0
153+
> TTL mykey
154+
(integer) -1
155+
> EXPIRE mykey 10 NX
156+
(integer) 1
157+
> TTL mykey
158+
(integer) 10
159+
{{< /clients-example >}}
160+
161+
Give these commands a try in the interactive console:
162+
140163
{{% redis-cli %}}
141164
SET mykey "Hello"
142165
EXPIRE mykey 10

content/commands/ft.info/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ is the name of the given index. You must first create the index using [`FT.CREAT
8080
| `hash_indexing_failures` | The number of failures encountered during indexing. |
8181
| `total_indexing_time` | The total time taken for indexing in seconds. |
8282
| `indexing` | Indicates whether the index is currently being generated. |
83-
| `percent_indexed` | The percentage of the index that has been successfully generated. |
83+
| `percent_indexed` | The percentage of the index that has been successfully generated (1 means 100%). |
8484
| `number_of_uses` | The number of times the index has been used. |
8585
| `cleaning` | The index deletion flag. A value of `1` indicates index deletion is in progress. |
8686

content/commands/ft.search/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,8 @@ orders the results by the value of this attribute. This applies to both text and
478478
<summary><code>LIMIT first num</code></summary>
479479

480480
limits the results to the offset and number of results given. Note that the offset is zero-indexed. The default is 0 10, which returns 10 items starting from the first result. You can use `LIMIT 0 0` to count the number of documents in the result set without actually returning them.
481+
482+
**`LIMIT` behavior**: If you use the `LIMIT` option without sorting, the results returned are non-deterministic, which means that subsequent queries may return duplicated or missing values. Add `SORTBY` with a unique field, or use `FT.AGGREGATE` with the `WITHCURSOR` option to ensure deterministic result set paging.
481483
</details>
482484

483485
<details open>

content/commands/hget/index.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,19 @@ Returns the value associated with `field` in the hash stored at `key`.
5353

5454
## Examples
5555

56+
{{< clients-example cmds_hash hget >}}
57+
> HSET myhash field1 "foo"
58+
(integer) 1
59+
> HGET myhash field1
60+
"foo"
61+
> HGET myhash field2
62+
(nil)
63+
{{< /clients-example >}}
64+
65+
Give these commands a try in the interactive console:
66+
5667
{{% redis-cli %}}
5768
HSET myhash field1 "foo"
5869
HGET myhash field1
5970
HGET myhash field2
6071
{{% /redis-cli %}}
61-

content/commands/hset/index.md

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,33 @@ If `key` doesn't exist, a new key holding a hash is created.
6868

6969
## Examples
7070

71+
{{< clients-example cmds_hash hset >}}
72+
> HSET myhash field1 "Hello"
73+
(integer) 1
74+
> HGET myhash field1
75+
"Hello"
76+
> HSET myhash field2 "Hi" field3 "World"
77+
(integer) 2
78+
> HGET myhash field2
79+
"Hi"
80+
> HGET myhash field3
81+
"World"
82+
> HGETALL myhash
83+
1) "field1"
84+
2) "Hello"
85+
3) "field2"
86+
4) "Hi"
87+
5) "field3"
88+
6) "World"
89+
{{< /clients-example >}}
90+
91+
Give these commands a try in the interactive console:
92+
7193
{{% redis-cli %}}
7294
HSET myhash field1 "Hello"
7395
HGET myhash field1
7496
HSET myhash field2 "Hi" field3 "World"
7597
HGET myhash field2
7698
HGET myhash field3
7799
HGETALL myhash
78-
{{% /redis-cli %}}
79-
100+
{{% /redis-cli %}}

content/commands/incr/index.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,23 @@ representation of the integer.
6767

6868
## Examples
6969

70+
{{< clients-example cmds_string incr >}}
71+
> SET mykey "10"
72+
"OK"
73+
> INCR mykey
74+
(integer) 11
75+
> GET mykey
76+
"11"
77+
{{< /clients-example >}}
78+
79+
Give this command a try in the interactive console:
80+
7081
{{% redis-cli %}}
7182
SET mykey "10"
7283
INCR mykey
7384
GET mykey
7485
{{% /redis-cli %}}
7586

76-
7787
## Pattern: Counter
7888

7989
The counter pattern is the most obvious thing you can do with Redis atomic

content/commands/json.mget/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ title: JSON.MGET
3333
Return the values at `path` from multiple `key` arguments
3434

3535
{{% warning %}}
36-
All specified keys must reside on the same [hash slot](https://redis.io/docs/latest/operate/oss_and_stack/reference/cluster-spec/#key-distribution-model).
36+
When cluster mode is enabled, all specified keys must reside on the same [hash slot](https://redis.io/docs/latest/operate/oss_and_stack/reference/cluster-spec/#key-distribution-model).
3737
{{% /warning %}}
3838

3939
[Examples](#examples)

content/commands/json.mset/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ Set or update one or more JSON values according to the specified `key`-`path`-`v
4444
A JSON value is a hierarchical structure. If you change a value in a specific path - nested values are affected.
4545

4646
{{% warning %}}
47-
All specified keys must reside on the same [hash slot](https://redis.io/docs/latest/operate/oss_and_stack/reference/cluster-spec/#key-distribution-model).
47+
When cluster mode is enabled, all specified keys must reside on the same [hash slot](https://redis.io/docs/latest/operate/oss_and_stack/reference/cluster-spec/#key-distribution-model).
4848
{{% /warning %}}
4949

5050
[Examples](#examples)

0 commit comments

Comments
 (0)