Compare commits

...

4 Commits

Author SHA1 Message Date
Gezi-lzq
5fa5a7553c
Merge bca5ee5552 into 685825b316 2025-08-22 22:27:54 +09:00
YG
685825b316
Merge pull request #366 from yangshangde/main
Some checks failed
Deploy Hugo site to Pages / build (push) Has been cancelled
Deploy Hugo site to Pages / deploy (push) Has been cancelled
Update ch8.md,电源失败改为电源失效
2025-08-22 17:29:33 +08:00
Jack Yang
31d1378772
Update ch8.md,电源失败改为电源失效 2025-08-22 14:48:35 +08:00
Gezi-lzq
bca5ee5552 feat: add Generate GitBook eBooks action 2025-05-25 19:07:54 +08:00
3 changed files with 43 additions and 2 deletions

41
.github/workflows/ebooks.yaml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Generate GitBook eBooks
on:
push:
branches:
- main
workflow_dispatch:
jobs:
build-ebook:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Pandoc
uses: siacodelabs/setup-pandoc@v1
with:
xelatex: true
- name: Generate EPUB file
run: make epub
- name: Create or update Release and upload EPUB
if: github.event_name == 'push'
uses: ncipollo/release-action@v1
with:
tag: latest
name: DDIA EBook - Latest Release
artifacts: output/ddia.epub
allowUpdates: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Upload generated eBooks
if: github.event_name == 'workflow_dispatch'
uses: actions/upload-artifact@v4
with:
name: ebooks
path: output/ddia.epub

View File

@ -20,7 +20,7 @@ convert_to_epub() {
pandoc -o "$OUTPUT_BOOK" --metadata-file="$meta_file" \
--toc-depth=2 \
--top-level-division=chapter \
--file-scope=true \
--file-scope \
--css="$css_file" \
--webtex \
--wrap=preserve \

View File

@ -163,7 +163,7 @@ SELECT COUNT(*) FROM emails WHERE recipient_id = 2 AND unread_flag = true
当单个对象被更改时,原子性和隔离性也适用。例如,假设你正在向数据库写入 20 KB 的 JSON 文档:
* 如果在发送了前 10 KB 后网络连接中断,数据库是否存储了无法解析的 10 KB JSON 片段?
* 如果数据库正在覆盖磁盘上的先前值的过程中电源失,你是否最终会将新旧值拼接在一起?
* 如果数据库正在覆盖磁盘上的先前值的过程中电源失,你是否最终会将新旧值拼接在一起?
* 如果另一个客户端在写入过程中读取该文档,它会看到部分更新的值吗?
这些问题会令人非常困惑,因此存储引擎几乎普遍的目标是在一个节点上的单个对象(如键值对)上提供原子性和隔离性。原子性可以使用日志实现崩溃恢复(参见["使 B 树可靠"](/ch4#sec_storage_btree_wal)),隔离性可以使用每个对象上的锁来实现(一次只允许一个线程访问对象)。