Skip to content

Commit 30e0e92

Browse files
committed
Merge branch 'main' into DOC-4192
2 parents 743e1a3 + 02da4c1 commit 30e0e92

File tree

239 files changed

+18796
-6036
lines changed

Some content is hidden

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

239 files changed

+18796
-6036
lines changed

.github/workflows/k8s_apis_sync.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,41 @@ jobs:
8080
sed -E -i 's/\[index\]/\[\]/g' artifacts/redis_enterprise_remote_cluster_api.md
8181
awk '/(#[^")]+)index/ {gsub(/index/,"")}; {print}' artifacts/redis_enterprise_remote_cluster_api.md > _tmp.md && mv _tmp.md artifacts/redis_enterprise_remote_cluster_api.md
8282
83+
- name: 'Generate YAML snippets'
84+
run: |-
85+
function formatYamlSnippet() {
86+
cat > "$2" << EOL
87+
\`\`\`yaml
88+
$(cat $1)
89+
\`\`\`
90+
EOL
91+
}
92+
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
117+
83118
- name: 'Send pull request'
84119
env:
85120
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
@@ -101,6 +136,8 @@ jobs:
101136
git apply content/operate/kubernetes/reference/kubernetes-api-reference-frontmatter.patch
102137
103138
git add content/operate/kubernetes/reference/
139+
git add content/embeds/
140+
104141
git commit -m "k8s api docs ${RELEASE}"
105142
git push origin "${BRANCH}"
106143

.github/workflows/rc_api_sync.yaml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: rc_api_sync
2+
3+
on:
4+
schedule:
5+
- cron: '0 0 * * *' # run every day at midnight UTC time
6+
workflow_dispatch: # or run on manual trigger
7+
8+
jobs:
9+
rc_api_sync:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
pull-requests: write
14+
actions: write
15+
steps:
16+
- name: 'Checkout'
17+
uses: 'actions/checkout@v3'
18+
19+
- name: 'Fetch openapi json file'
20+
env:
21+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
22+
run: |
23+
branch="rc_api_sync"
24+
spec_change=false
25+
26+
# check if remote branch already exists
27+
git fetch --all
28+
set +e
29+
git ls-remote --exit-code --heads origin "refs/heads/${branch}"
30+
if [ "$?" -eq 0 ]; then
31+
set -e
32+
# if it does, create local branch off existing remote branch
33+
git checkout -b "${branch}" "origin/${branch}"
34+
git branch --set-upstream-to="origin/${branch}" "${branch}"
35+
git pull
36+
else
37+
set -e
38+
# otherwise, create local branch from main
39+
git checkout -b "${branch}"
40+
fi
41+
42+
curl -Ls https://api.redislabs.com/v1/cloud-api-docs \
43+
| jq '(.. | .example? | try select(test("^{"))) |= fromjson' > content/operate/rc/api/api-reference/openapi.json
44+
45+
spec_is_different=$(git diff content/operate/rc/api/api-reference/openapi.json)
46+
47+
if [[ ! -z $spec_is_different ]]; then
48+
spec_change=true
49+
50+
git add "content/operate/rc/api/api-reference/openapi.json"
51+
git config user.email "177626021+redisdocsapp[bot]@users.noreply.github.com"
52+
git config user.name "redisdocsapp[bot]"
53+
git commit -m "Update content/operate/rc/api/api-reference/openapi.json"
54+
fi
55+
56+
if [ "$spec_change" = true ] ; then
57+
git push origin "${branch}"
58+
59+
# If a pr is not already open, create one
60+
set +e
61+
gh search prs -R redis/docs --state open --match title "update rc openapi spec" | grep -q "update rc openapi spec"
62+
if [ "$?" -eq 1 ]; then
63+
set -e
64+
gh pr create \
65+
--body "update rc openapi spec" \
66+
--title "update rc openapi spec" \
67+
--head "$branch" \
68+
--base "main"
69+
fi
70+
fi

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
/data/repos.json
77
/data/tool_types.json
88
/data/versions.json
9+
/data/components_local/
910
/examples
1011
build/components/__pycache__/
1112
venv/**
@@ -14,3 +15,4 @@ package-lock.json
1415
.hugo_build.lock
1516
.vscode/
1617
.DS_Store
18+
.idea

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ HUGO_BUILD=--gc
44

55
all: clean deps components hugo
66
serve: clean deps components serve_hugo
7+
localserve: clean deps components_local serve_hugo
78

89
deps:
910
@npm install
@@ -13,6 +14,9 @@ deps:
1314
components:
1415
@python3 build/make.py
1516

17+
components_local:
18+
@python3 build/make.py --stack ./data/components_local/index.json
19+
1620
hugo:
1721
@hugo $(HUGO_DEBUG) $(HUGO_BUILD)
1822

content/apis/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ Redis Cloud is a fully managed Database as a Service offering and the fastest wa
4545

4646
- [Redis Cloud REST API introduction]({{< relref "/operate/rc/api/" >}})
4747
- [Redis Cloud REST API examples]({{< relref "/operate/rc/api/examples/" >}})
48-
- [Redis Cloud REST API reference](https://api.redislabs.com/v1/swagger-ui.html)
48+
- [Redis Cloud REST API reference]({{< relref "/operate/rc/api/api-reference" >}})
4949

5050

5151
### Redis Enterprise Software API

content/commands/auth/index.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ The AUTH command authenticates the current connection in two cases:
5151
Redis versions prior of Redis 6 were only able to understand the one argument
5252
version of the command:
5353

54-
AUTH <password>
54+
{{< clients-example cmds_cnxmgmt auth1 >}}
55+
AUTH "temp-pass"
56+
{{< /clients-example >}}
5557

5658
This form just authenticates against the password set with `requirepass`.
5759
In this configuration Redis will deny any command executed by the just
@@ -62,7 +64,9 @@ Otherwise, an error is returned and the clients needs to try a new password.
6264

6365
When Redis ACLs are used, the command should be given in an extended way:
6466

65-
AUTH <username> <password>
67+
{{< clients-example cmds_cnxmgmt auth2 >}}
68+
AUTH "test-user" "strong_password"
69+
{{< /clients-example >}}
6670

6771
In order to authenticate the current connection with one of the connections
6872
defined in the ACL list (see [`ACL SETUSER`]({{< relref "/commands/acl-setuser" >}})) and the official [ACL guide]({{< relref "/operate/oss_and_stack/management/security/acl" >}}) for more information.

content/commands/bf.reserve/index.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,13 @@ Though the filter can scale up by creating sub-filters, it is recommended to res
4646
sub-filters requires additional memory (each sub-filter uses an extra bits and hash function) and consume further CPU time than an equivalent filter that had
4747
the right capacity at creation time.
4848

49-
The number of hash functions is `-log(error)/ln(2)^2`.
50-
The number of bits per item is `-log(error)/ln(2)` ≈ 1.44.
49+
The optimal number of hash functions is `ceil(-ln(error_rate) / ln(2))`.
5150

52-
* **1%** error rate requires 7 hash functions and 10.08 bits per item.
53-
* **0.1%** error rate requires 10 hash functions and 14.4 bits per item.
54-
* **0.01%** error rate requires 14 hash functions and 20.16 bits per item.
51+
The required number of bits per item, given the desired `error_rate` and the optimal number of hash functions, is `-ln(error_rate) / ln(2)^2`. Hence, the required number of bits in the filter is `capacity * -ln(error_rate) / ln(2)^2`.
52+
53+
* **1%** error rate requires 7 hash functions and 9.585 bits per item.
54+
* **0.1%** error rate requires 10 hash functions and 14.378 bits per item.
55+
* **0.01%** error rate requires 14 hash functions and 19.170 bits per item.
5556

5657
## Required arguments
5758

@@ -86,7 +87,7 @@ Non-scaling filters requires slightly less memory than their scaling counterpart
8687
When `capacity` is reached, an additional sub-filter is created.
8788
The size of the new sub-filter is the size of the last sub-filter multiplied by `expansion`, specified as a positive integer.
8889

89-
If the number of elements to be stored in the filter is unknown, you use an `expansion` of `2` or more to reduce the number of sub-filters.
90+
If the number of items to be stored in the filter is unknown, you use an `expansion` of `2` or more to reduce the number of sub-filters.
9091
Otherwise, you use an `expansion` of `1` to reduce memory consumption. The default value is `2`.
9192
</details>
9293

content/commands/bitpos/index.md

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -104,16 +104,25 @@ Non-existent keys are treated as empty strings.
104104

105105
## Examples
106106

107-
{{% redis-cli %}}
108-
SET mykey "\xff\xf0\x00"
109-
BITPOS mykey 0
110-
SET mykey "\x00\xff\xf0"
111-
BITPOS mykey 1 0
112-
BITPOS mykey 1 2
113-
BITPOS mykey 1 2 -1 BYTE
114-
BITPOS mykey 1 7 15 BIT
115-
set mykey "\x00\x00\x00"
116-
BITPOS mykey 1
117-
BITPOS mykey 1 7 -3 BIT
118-
{{% /redis-cli %}}
119-
107+
```redis
108+
redis> SET mykey "\xff\xf0\x00"
109+
OK
110+
redis> BITPOS mykey 0
111+
(integer) 12
112+
redis> SET mykey "\x00\xff\xf0"
113+
OK
114+
redis> BITPOS mykey 1 0
115+
(integer) 8
116+
redis> BITPOS mykey 1 2
117+
(integer) 16
118+
redis> BITPOS mykey 1 2 -1 BYTE
119+
(integer) 16
120+
redis> BITPOS mykey 1 7 15 BIT
121+
(integer) 8
122+
redis> set mykey "\x00\x00\x00"
123+
OK
124+
redis> BITPOS mykey 1
125+
(integer) -1
126+
redis> BITPOS mykey 1 7 -3 BIT
127+
(integer) -1
128+
```

content/commands/client-list/index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@ Here is the meaning of the fields:
114114
* `user`: the authenticated username of the client
115115
* `redir`: client id of current client tracking redirection
116116
* `resp`: client RESP protocol version. Added in Redis 7.0
117+
* `rbp`: peak size of the client's read buffer since the client connected. Added in Redis 7.0
118+
* `rbs`: current size of the client's read buffer in bytes. Added in Redis 7.0
117119

118120
The client flags can be a combination of:
119121

content/commands/cluster-forget/index.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ complexity: O(1)
2626
description: Removes a node from the nodes table.
2727
group: cluster
2828
hidden: false
29+
history:
30+
- - 7.2.0
31+
- Forgotten nodes are automatically propagated across the cluster via gossip.
2932
linkTitle: CLUSTER FORGET
3033
since: 3.0.0
3134
summary: Removes a node from the nodes table.
@@ -49,6 +52,10 @@ table of the node receiving the command, it also implements a ban-list, not
4952
allowing the same node to be added again as a side effect of processing the
5053
*gossip section* of the heartbeat packets received from other nodes.
5154

55+
Starting with Redis 7.2.0, the ban-list is included in cluster gossip ping/pong messages.
56+
This means that `CLUSTER FORGET` doesn't need to be sent to all nodes in a cluster.
57+
You can run the command on one or more nodes, after which it will be propagated to the rest of the nodes in most cases.
58+
5259
## Details on why the ban-list is needed
5360

5461
In the following example we'll show why the command must not just remove
@@ -86,3 +93,8 @@ The command does not succeed and returns an error in the following cases:
8693
1. The specified node ID is not found in the nodes table.
8794
2. The node receiving the command is a replica, and the specified node ID identifies its current master.
8895
3. The node ID identifies the same node we are sending the command to.
96+
97+
## Behavior change history
98+
99+
* `>= 7.2.0`: Automatically propagate node deletion to other nodes in a cluster, allowing nodes to be deleted with a single call
100+
in most cases.

0 commit comments

Comments
 (0)