95 lines
7.9 KiB
XML
95 lines
7.9 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="680" height="2127" viewBox="0 0 680 2127" role="img" aria-labelledby="diagram-title diagram-description">
|
|
<title id="diagram-title">fsync() 의 요구가 물리 storage 까지 내려가는 사슬</title>
|
|
<desc id="diagram-description">위에서 아래로 읽는다. 맨 위 PostgreSQL 이 fsync() 를 부르고 그 요구가 Guest Filesystem 으로 내려간다. Guest Block Layer 에서 FLUSH 등의 요청으로 바뀌고, virtio-blk 를 지나 VM 경계를 넘어 QEMU / Backend 로 간다. 거기서 Host Storage Stack 을 지나 맨 아래 Physical Storage 까지 그 의미가 전달되어야 완료가 성립한다. 여섯 번 손이 바뀌는 동안 한 곳이라도 그 의미를 지키지 않으면 게스트가 받은 완료 응답이 거짓이 된다. write() 완료와 writeback 완료, fsync/flush 완료, 전원 장애에도 안전한 durability 가 서로 다르다는 구분은 본문의 코드블록이 맡는다.</desc>
|
|
<metadata>{"techviz":{"spec_version":"1.1","id":"write-completion-boundaries","profile":"component-flow"},"source_context":{"document":"docs/virtualization/final/document.md","document_sha256":"8c4ecc64c8cea9a4450ed7131fdd9cb2048dc092b66cd969f6346ed77887c210","anchor":{"kind":"heading","value":"150. `fsync()`가 필요한 이유","line":6736}},"evidence_policy":"Each factual element cites source lines or is marked assumption.","diagram_only":true}</metadata>
|
|
<defs>
|
|
<marker id="arrow" viewBox="0 0 10 10" refX="9" refY="5" markerWidth="7" markerHeight="7" orient="auto-start-reverse">
|
|
<path d="M 0 0 L 10 5 L 0 10 z" />
|
|
</marker>
|
|
<style>
|
|
:root { color-scheme: light; }
|
|
text { font-family: Inter, Pretendard, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; fill: #111827; }
|
|
.canvas { fill: #ffffff; }
|
|
.group-box { fill: #ffffff; stroke: #9ca3af; stroke-width: 1.4; stroke-dasharray: 7 5; }
|
|
.group-label-bg { fill: #ffffff; }
|
|
.group-label { font-size: 13px; font-weight: 650; fill: #374151; }
|
|
.edge { fill: none; stroke: #374151; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; marker-end: url(#arrow); }
|
|
.edge.style-dashed, .edge.semantic-dashed, .edge.assumption { stroke-dasharray: 7 5; }
|
|
.edge.style-dotted { stroke-dasharray: 2 5; }
|
|
.edge.emphasis-primary { stroke: #2563eb; stroke-width: 2.2; }
|
|
.edge.emphasis-muted { stroke: #9ca3af; }
|
|
.edge.emphasis-warning, .edge.kind-failure, .edge.kind-error { stroke: #dc2626; stroke-width: 2.2; }
|
|
.edge-label-bg { fill: #ffffff; }
|
|
.edge-label { font-size: 12px; font-weight: 560; text-anchor: middle; }
|
|
.node-shape { fill: #ffffff; stroke: #4b5563; stroke-width: 1.7; }
|
|
.node-shape.emphasis-primary { stroke: #2563eb; stroke-width: 2.2; }
|
|
.node-shape.emphasis-muted { stroke: #9ca3af; fill: #f9fafb; }
|
|
.node-shape.emphasis-warning { stroke: #d97706; stroke-width: 2; fill: #fffdf5; }
|
|
.node-shape.kind-database, .node-shape.kind-datastore, .node-shape.kind-storage { fill: #f8fafc; }
|
|
.node-shape.kind-queue, .node-shape.kind-event, .node-shape.kind-topic { fill: #fafafa; }
|
|
.node-shape.assumption { stroke-dasharray: 4 4; }
|
|
.storage-bottom, .controller-divider { fill: none; stroke: #4b5563; stroke-width: 1.4; }
|
|
.controller-led { fill: #4b5563; }
|
|
.actor-symbol { fill: none; stroke: #4b5563; stroke-width: 1.8; stroke-linecap: round; }
|
|
.actor-symbol.emphasis-primary { stroke: #2563eb; stroke-width: 2.2; }
|
|
.node-label { font-size: 14px; font-weight: 650; text-anchor: middle; }
|
|
.node-role { font-size: 10px; letter-spacing: 0.04em; text-anchor: middle; fill: #6b7280; }
|
|
.node-detail-divider { stroke: #d1d5db; stroke-width: 1; }
|
|
.node-detail { font-size: 11px; fill: #374151; }
|
|
.assumption-badge { font-size: 9px; font-weight: 700; fill: #92400e; }
|
|
.failure-mark { stroke: #dc2626; stroke-width: 4; stroke-linecap: round; }
|
|
.lifeline { stroke: #9ca3af; stroke-width: 1.2; stroke-dasharray: 5 5; }
|
|
.timeline-axis { stroke: #374151; stroke-width: 1.8; marker-end: url(#arrow); }
|
|
.timeline-stem { stroke: #6b7280; stroke-width: 1.3; }
|
|
.timeline-marker { fill: #ffffff; stroke: #374151; stroke-width: 1.7; }
|
|
.timeline-marker.primary { fill: #2563eb; stroke: #2563eb; }
|
|
.timeline-marker.warning { fill: #dc2626; stroke: #dc2626; }
|
|
.timeline-label { font-size: 13px; font-weight: 650; text-anchor: middle; }
|
|
.timeline-detail { font-size: 11px; fill: #4b5563; text-anchor: middle; }
|
|
</style>
|
|
</defs>
|
|
<rect class="canvas" width="680" height="2127" />
|
|
<polyline class="edge kind-control style-solid emphasis-normal" points="110.0,233.0 110.0,344.0 122.0,344.0 122.0,455.0" data-evidence="6757-6759" />
|
|
<rect class="edge-label-bg" x="83.5" y="302.0" width="64.9" height="22" rx="3" />
|
|
<text class="edge-label" x="116.0" y="317.0">fsync()</text>
|
|
<polyline class="edge kind-control style-solid emphasis-normal" points="122.0,519.0 122.0,642.0 123.5,642.0 123.5,765.0" data-evidence="6759-6762" />
|
|
<polyline class="edge kind-control style-solid emphasis-normal" points="123.5,829.0 123.5,953.5 122.0,953.5 122.0,1078.0" data-evidence="6764-6766" />
|
|
<rect class="edge-label-bg" x="90.3" y="911.5" width="64.9" height="22" rx="3" />
|
|
<text class="edge-label" x="122.8" y="926.5">FLUSH 등</text>
|
|
<polyline class="edge kind-control style-solid emphasis-normal" points="122.0,1142.0 122.0,1265.0 122.0,1265.0 122.0,1388.0" data-evidence="6766-6769" />
|
|
<polyline class="edge kind-control style-solid emphasis-normal" points="122.0,1452.0 122.0,1575.0 127.0,1575.0 127.0,1698.0" data-evidence="6769-6772" />
|
|
<polyline class="edge kind-control style-solid emphasis-normal" points="127.0,1762.0 127.0,1890.0 122.0,1890.0 122.0,2018.0" data-evidence="6772-6778" />
|
|
<g id="node-postgresql">
|
|
<rect class="node-shape kind-service emphasis-normal role-source" data-evidence="6755-6755,6739-6747" x="35.0" y="145.0" width="150.0" height="88.0" rx="7" />
|
|
<text class="node-label" x="110.0" y="172.0">PostgreSQL</text>
|
|
<line class="node-detail-divider" x1="49.0" y1="193.0" x2="171.0" y2="193.0" />
|
|
<text class="node-detail" x="51.0" y="210.0">write()</text>
|
|
<text class="node-detail" x="51.0" y="226.0">fsync()</text>
|
|
</g>
|
|
<g id="node-guest-filesystem">
|
|
<rect class="node-shape kind-service emphasis-normal role-service" data-evidence="6759-6759" x="47.0" y="455.0" width="150.0" height="64.0" rx="7" />
|
|
<text class="node-label" x="122.0" y="485.0">Guest Filesystem</text>
|
|
</g>
|
|
<g id="node-guest-block-layer">
|
|
<rect class="node-shape kind-service emphasis-normal role-service" data-evidence="6762-6764" x="47.0" y="765.0" width="153.0" height="64.0" rx="7" />
|
|
<text class="node-label" x="123.5" y="795.0">Guest Block Layer</text>
|
|
</g>
|
|
<g id="node-virtio-blk">
|
|
<rect class="node-shape kind-service emphasis-normal role-service" data-evidence="6766-6766" x="47.0" y="1078.0" width="150.0" height="64.0" rx="7" />
|
|
<text class="node-label" x="122.0" y="1108.0">virtio-blk</text>
|
|
</g>
|
|
<g id="node-qemu-backend">
|
|
<rect class="node-shape kind-service emphasis-normal role-service" data-evidence="6769-6769,6699-6699" x="47.0" y="1388.0" width="150.0" height="64.0" rx="7" />
|
|
<text class="node-label" x="122.0" y="1418.0">QEMU / Backend</text>
|
|
</g>
|
|
<g id="node-host-storage-stack">
|
|
<rect class="node-shape kind-service emphasis-normal role-service" data-evidence="6772-6772,6701-6705" x="47.0" y="1698.0" width="160.0" height="64.0" rx="7" />
|
|
<text class="node-label" x="127.0" y="1728.0">Host Storage Stack</text>
|
|
</g>
|
|
<g id="node-physical-storage">
|
|
<rect class="node-shape kind-store emphasis-primary role-sink" data-evidence="6775-6778,6742-6742" x="47.0" y="2018.0" width="150.0" height="64.0" rx="7" />
|
|
<text class="node-label" x="122.0" y="2048.0">Physical Storage</text>
|
|
</g>
|
|
</svg>
|