From 803f4d4476c1874769c34af87e50d6e5468fc87d Mon Sep 17 00:00:00 2001 From: yikeke Date: Fri, 3 Jul 2020 11:03:40 +0800 Subject: [PATCH 1/2] add anchor check to 2.1 branch --- .circleci/config.yml | 17 +++++++++++++++-- scripts/verify-link-anchors.sh | 14 ++++++++++++++ scripts/verify-links.sh | 7 +++---- 3 files changed, 32 insertions(+), 6 deletions(-) create mode 100755 scripts/verify-link-anchors.sh diff --git a/.circleci/config.yml b/.circleci/config.yml index 09b1df9b4429a..0add63c57ae39 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -3,15 +3,23 @@ version: 2 jobs: lint: docker: - - image: circleci/ruby:2.4.1-node + - image: circleci/node:lts working_directory: ~/pingcap/docs steps: - checkout + - run: + name: Setup + command: | + mkdir ~/.npm-global + npm config set prefix '~/.npm-global' + echo 'export PATH=~/.npm-global/bin:$PATH' >> $BASH_ENV + echo 'export NODE_PATH=~/.npm-global/lib/node_modules:$NODE_PATH' >> $BASH_ENV + - run: name: "Install markdownlint" command: | - sudo npm install -g markdownlint-cli@0.17.0 + npm install -g markdownlint-cli@0.17.0 - run: name: "Lint README" @@ -29,6 +37,11 @@ jobs: command: | scripts/verify-links.sh + - run: + name: "Check link anchors" + command: | + scripts/verify-link-anchors.sh + build: docker: - image: andelf/doc-build:0.1.9 diff --git a/scripts/verify-link-anchors.sh b/scripts/verify-link-anchors.sh new file mode 100755 index 0000000000000..445159d537f15 --- /dev/null +++ b/scripts/verify-link-anchors.sh @@ -0,0 +1,14 @@ +#!/bin/bash +# +# In addition to verify-links.sh, this script additionally check anchors. +# +# See https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally if you meet permission problems when executing npm install. + +ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd) +cd $ROOT + +npm install -g remark-cli remark-lint breeswish/remark-lint-pingcap-docs-anchor + +echo "info: checking links anchors under $ROOT directory..." + +remark --ignore-path .gitignore -u lint -u remark-lint-pingcap-docs-anchor . --frail --quiet diff --git a/scripts/verify-links.sh b/scripts/verify-links.sh index 300b75d8401c7..70b5b38c8aba6 100755 --- a/scripts/verify-links.sh +++ b/scripts/verify-links.sh @@ -10,13 +10,12 @@ # - When a file was moved, all other references are required to be updated for now, even if alias are given # - This is recommended because of less redirects and better anchors support. # +# See https://docs.npmjs.com/resolving-eacces-permissions-errors-when-installing-packages-globally if you meet permission problems when executing npm install. ROOT=$(unset CDPATH && cd $(dirname "${BASH_SOURCE[0]}")/.. && pwd) cd $ROOT -if ! which markdown-link-check &>/dev/null; then - sudo npm install -g markdown-link-check@3.7.3 -fi +npm install -g markdown-link-check@3.8.1 VERBOSE=${VERBOSE:-} CONFIG_TMP=$(mktemp) @@ -50,7 +49,7 @@ fi while read -r tasks; do for task in $tasks; do ( - output=$(markdown-link-check --color --config "$CONFIG_TMP" "$task" -q) + output=$(markdown-link-check --config "$CONFIG_TMP" "$task" -q) if [ $? -ne 0 ]; then printf "$output" >> $ERROR_REPORT fi From e019d5b1055afeb2d52e9e2aa679ae038c012d39 Mon Sep 17 00:00:00 2001 From: yikeke Date: Fri, 3 Jul 2020 12:41:32 +0800 Subject: [PATCH 2/2] fix 6 anchors --- faq/tidb-faq.md | 2 +- glossary.md | 2 +- optimistic-transaction.md | 2 +- tidb-binlog/handle-tidb-binlog-errors.md | 2 +- tidb-lightning/deploy-tidb-lightning.md | 2 +- tune-operating-system.md | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/faq/tidb-faq.md b/faq/tidb-faq.md index 5073c77f1880c..51fc9982b3d5c 100644 --- a/faq/tidb-faq.md +++ b/faq/tidb-faq.md @@ -378,7 +378,7 @@ Similar to MySQL, TiDB includes static and solid parameters. You can directly mo #### Where and what are the data directories in TiDB (TiKV)? -TiKV data is located in the [`--data-dir`](/tikv-configuration-file.md#data-dir), which include four directories of backup, db, raft, and snap, used to store backup, data, Raft data, and mirror data respectively. +TiKV data is located in the [`--data-dir`](/tikv-configuration-file.md#--data-dir), which include four directories of backup, db, raft, and snap, used to store backup, data, Raft data, and mirror data respectively. #### What are the system tables in TiDB? diff --git a/glossary.md b/glossary.md index fcae4bed8dcab..76735addcb816 100644 --- a/glossary.md +++ b/glossary.md @@ -13,7 +13,7 @@ aliases: ['/docs/v2.1/glossary/'] ACID refers to the four key properties of a transaction: atomicity, consistency, isolation, and durability. Each of these properties is described below. -- **Atomicity** means that either all the changes of an operation are performed, or none of them are. TiDB ensures the atomicity of the [Region](#region) that stores the Primary Key to achieve the atomicity of transactions. +- **Atomicity** means that either all the changes of an operation are performed, or none of them are. TiDB ensures the atomicity of the [Region](#regionpeerraft-group) that stores the Primary Key to achieve the atomicity of transactions. - **Consistency** means that transactions always bring the database from one consistent state to another. In TiDB, data consistency is ensured before writing data to the memory. diff --git a/optimistic-transaction.md b/optimistic-transaction.md index 15e9e1d497967..a589cb9c0fb78 100644 --- a/optimistic-transaction.md +++ b/optimistic-transaction.md @@ -59,7 +59,7 @@ However, TiDB transactions also have the following disadvantages: * In need of a centralized version manager * OOM (out of memory) when extensive data is written in the memory -To avoid potential problems in application, refer to [transaction sizes](/transaction-overview.md#transaction-size) to see more details. +To avoid potential problems in application, refer to [transaction sizes](/transaction-overview.md#transaction-sizes) to see more details. ## Transaction retries diff --git a/tidb-binlog/handle-tidb-binlog-errors.md b/tidb-binlog/handle-tidb-binlog-errors.md index 761dc8c9f1903..867bd3425dcec 100644 --- a/tidb-binlog/handle-tidb-binlog-errors.md +++ b/tidb-binlog/handle-tidb-binlog-errors.md @@ -33,4 +33,4 @@ Solution: Clean up the disk space and then restart Pump. Cause: When Pump is started, it notifies all Drainer nodes that are in the `online` state. If it fails to notify Drainer, this error log is printed. -Solution: Use the [binlogctl tool](/tidb-binlog/maintain-tidb-binlog-cluster.md#binlog-guide) to check whether each Drainer node is normal or not. This is to ensure that all Drainer nodes that are in the `online` state are working normally. If the state of a Drainer node is not consistent with its actual working status, use the binlogctl tool to change its state and then restart Pump. +Solution: Use the [binlogctl tool](/tidb-binlog/maintain-tidb-binlog-cluster.md#binlogctl-guide) to check whether each Drainer node is normal or not. This is to ensure that all Drainer nodes that are in the `online` state are working normally. If the state of a Drainer node is not consistent with its actual working status, use the binlogctl tool to change its state and then restart Pump. diff --git a/tidb-lightning/deploy-tidb-lightning.md b/tidb-lightning/deploy-tidb-lightning.md index 7e9b733ec347f..8d387d96b2579 100644 --- a/tidb-lightning/deploy-tidb-lightning.md +++ b/tidb-lightning/deploy-tidb-lightning.md @@ -95,7 +95,7 @@ If the data source consists of CSV files, see [CSV support](/tidb-lightning/migr This section describes two deployment methods of TiDB Lightning: -- [Deploy TiDB Lightning using TiDB Ansible](#deploy-tidb-lightning-using-ansible) +- [Deploy TiDB Lightning using TiDB Ansible](#deploy-tidb-lightning-using-tidb-ansible) - [Deploy TiDB Lightning manually](#deploy-tidb-lightning-manually) ### Deploy TiDB Lightning using TiDB Ansible diff --git a/tune-operating-system.md b/tune-operating-system.md index ba4a24e6ce497..e6e6c2383b065 100644 --- a/tune-operating-system.md +++ b/tune-operating-system.md @@ -61,7 +61,7 @@ cpufreq is a module that dynamically adjusts the CPU frequency. It supports five ### NUMA CPU binding -To avoid accessing memory across Non-Uniform Memory Access (NUMA) nodes as much as possible, you can bind a thread/process to certain CPU cores by setting the CPU affinity of the thread. For ordinary programs, you can use the `numactl` command for the CPU binding. For detailed usage, see the Linux manual pages. For network interface card (NIC) interrupts, see [tune network](#tune-network). +To avoid accessing memory across Non-Uniform Memory Access (NUMA) nodes as much as possible, you can bind a thread/process to certain CPU cores by setting the CPU affinity of the thread. For ordinary programs, you can use the `numactl` command for the CPU binding. For detailed usage, see the Linux manual pages. For network interface card (NIC) interrupts, see [tune network](#network-tuning). ### Memory—transparent huge page (THP)