Files
progcode/web/public/assets/editorial/2021/distributed-lock-fence-boundary-2021.svg
T
huncode 32e0550f4f
Build and deploy / deploy (push) Successful in 15s
revise May 2021 distributed lock articles
2026-07-31 12:37:36 +03:00

66 lines
4.5 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 720 1500" role="img" aria-labelledby="title desc">
<title id="title">Граница fencing token между lock authority и ресурсом</title>
<desc id="desc">Вертикальная схема показывает, что lock authority выдаёт lease и поколения владения, а защищаемый ресурс хранит наибольший принятый token. Token два принимается, а поздний token один отклоняется внутри ресурса.</desc>
<defs>
<marker id="arrow" viewBox="0 0 12 12" refX="10" refY="6" markerWidth="10" markerHeight="10" orient="auto-start-reverse">
<path d="M1 1 L11 6 L1 11z" fill="#9fb7d7"/>
</marker>
<style>
.bg { fill: #0b1324; }
.authority { fill: #173e45; stroke: #48c5be; stroke-width: 3; }
.worker { fill: #14213a; stroke: #42658f; stroke-width: 3; }
.resource { fill: #1a4136; stroke: #67d5a6; stroke-width: 3; }
.warn { fill: #422a30; stroke: #ff9a80; stroke-width: 3; }
.line { stroke: #9fb7d7; stroke-width: 5; fill: none; marker-end: url(#arrow); }
.warnline { stroke: #ff9a80; stroke-width: 5; fill: none; marker-end: url(#arrow); }
.title { fill: #ffffff; font: 700 34px Arial, sans-serif; }
.label { fill: #eaf2ff; font: 600 27px Arial, sans-serif; }
.body { fill: #d2def2; font: 24px Arial, sans-serif; }
.small { fill: #b6c7e3; font: 22px Arial, sans-serif; }
.tag { fill: #87e5db; font: 700 21px Arial, sans-serif; letter-spacing: 1px; }
.badtag { fill: #ffbfaa; font: 700 21px Arial, sans-serif; letter-spacing: 1px; }
</style>
</defs>
<rect class="bg" width="720" height="1500" rx="32"/>
<text x="360" y="62" text-anchor="middle" class="title">Fence живёт в ресурсе</text>
<text x="360" y="96" text-anchor="middle" class="small">lease и write отвечают на разные вопросы</text>
<rect x="72" y="142" width="576" height="173" rx="22" class="authority"/>
<text x="108" y="185" class="tag">LOCK AUTHORITY</text>
<text x="108" y="227" class="label">выдаёт lease-1 / token 1</text>
<text x="108" y="260" class="body">знает lifecycle текущего lock</text>
<text x="108" y="292" class="small">не меняет защищаемый ресурс</text>
<path d="M360 315 L360 367" class="line"/>
<rect x="72" y="367" width="576" height="161" rx="22" class="worker"/>
<text x="108" y="409" class="tag">WORKER-A</text>
<text x="108" y="451" class="label">пауза дольше lease</text>
<text x="108" y="484" class="body">старый payload и token 1 остаются</text>
<path d="M360 528 L360 580" class="line"/>
<rect x="72" y="580" width="576" height="174" rx="22" class="authority"/>
<text x="108" y="622" class="tag">LOCK AUTHORITY AFTER EXPIRY</text>
<text x="108" y="664" class="label">выдаёт lease-2 / token 2</text>
<text x="108" y="697" class="body">worker-B становится новым владельцем</text>
<text x="108" y="729" class="small">expiry не отзывает request от worker-A</text>
<path d="M360 754 L360 806" class="line"/>
<rect x="72" y="806" width="576" height="178" rx="22" class="resource"/>
<text x="108" y="848" class="tag">PROTECTED RESOURCE</text>
<text x="108" y="890" class="label">принимает write с token 2</text>
<text x="108" y="923" class="body">сохраняет value v2 и highest token 2</text>
<text x="108" y="956" class="small">сравнение и write — одна граница</text>
<path d="M360 984 L360 1036" class="warnline"/>
<rect x="72" y="1036" width="576" height="179" rx="22" class="warn"/>
<text x="108" y="1078" class="badtag">LATE REQUEST FROM WORKER-A</text>
<text x="108" y="1120" class="label">token 1 ≤ highest token 2</text>
<text x="108" y="1153" class="body">resource returns rejected-stale-fence</text>
<text x="108" y="1186" class="small">authority не обязан участвовать в этом write</text>
<rect x="72" y="1270" width="576" height="150" rx="22" fill="#14213a" stroke="#42658f" stroke-width="3"/>
<text x="360" y="1312" text-anchor="middle" class="label">Без проверки в ресурсе</text>
<text x="360" y="1348" text-anchor="middle" class="label">поздний v1 может перезаписать v2</text>
<text x="360" y="1384" text-anchor="middle" class="small">Сам lock не доказывает безопасность внешнего эффекта.</text>
</svg>