Cane Agency · Exhibit to PROP-028 (study — informs OQ-4, decides nothing)สถาบันอ้อย · เอกสารประกอบ PROP-028 (การศึกษา — ให้ข้อมูลแก่ OQ-4 ไม่ตัดสินอะไร)
| # | Sourceแหล่ง | What it establishesสิ่งที่ยืนยัน |
|---|---|---|
| S-1 | PostgreSQL documentation — log-shipping standby servers (warm standby)เอกสาร PostgreSQL — log-shipping standby (warm standby) | A warm/hot standby requires no changes to the database tables; primary and standby are loosely coupled with low administration overhead — the standby layer is configuration, not schema. Asynchronous shipping leaves a bounded data-loss window (the RPO); restore-from-backup is much slower (DR, not HA).warm/hot standby ไม่ต้องแก้ตารางฐานข้อมูล; primary กับ standby ผูกกันหลวม ๆ ภาระดูแลต่ำ — ชั้น standby คือ configuration ไม่ใช่ schema; การส่งแบบ async มีหน้าต่างข้อมูลหายจำกัด (RPO); กู้จาก backup ช้ากว่ามาก (เป็น DR ไม่ใช่ HA) |
| S-2 | pgDash — physical replication mechanismspgDash — กลไก physical replication | The standby ladder is standard vocabulary: cold (starts on failover) → warm (continuously applying, no clients) → hot (read-only clients) — a graded, incremental path, not one big step.บันได standby เป็นศัพท์มาตรฐาน: cold (เริ่มเมื่อ failover) → warm (apply ต่อเนื่อง ไม่รับ client) → hot (client อ่านอย่างเดียว) — เส้นทางไล่ระดับ ไม่ใช่ก้าวเดียวใหญ่ |
| S-3 | AWS IoT blog — HA patterns for IoT Greengrass using Pacemaker (2025)บล็อก AWS IoT — แบบแผน HA ของ Greengrass ด้วย Pacemaker (2025) | Edge-gateway HA is delivered as added orchestration (Pacemaker cluster manager, DRBD state replication, active/passive) on top of an unchanged edge runtime — evidence that the pair itself is a later operational layer.HA ของ edge gateway ส่งมอบเป็นชั้น orchestration ที่เพิ่มทีหลัง (Pacemaker, DRBD, active/passive) บน runtime เดิมที่ไม่เปลี่ยน — หลักฐานว่าตัว pair เป็นชั้นปฏิบัติการภายหลังได้ |
| S-4 | Azure IoT Edge HA field guidanceแนวปฏิบัติ HA ของ Azure IoT Edge | The pragmatic edge menu: hypervisor clustering (the app unaware it is HA), and — simplest and lowest cost — spare hardware plus cloud-held configuration, with downstream devices queueing data so a timely swap loses nothing. Load-balanced twin gateways break down for offline/parent-child cases — a caution against naive active-active at the edge.เมนูภาคปฏิบัติของ edge: clustering ระดับ hypervisor (แอปไม่รู้ว่าตนอยู่ในโหมด HA) และ — ง่ายและถูกที่สุด — เครื่องสำรอง + configuration เก็บบน cloud โดยอุปกรณ์ปลายน้ำ queue ข้อมูลไว้ สลับเครื่องทันเวลาก็ไม่หายอะไร; gateway คู่แบบ load balance ล้มเหลวกับกรณี offline/parent-child — คำเตือนต่อ active-active แบบไร้เดียงสาที่ edge |
| S-5 | Fencing / split-brain literature (Linux-HA, Pacemaker lineage)วรรณกรรม fencing / split-brain (สาย Linux-HA, Pacemaker) | Fencing exists because a live cluster cannot distinguish a dead peer from an unreachable one; without it a partition yields two primaries writing concurrently — data corruption. Split-brain is the canonical catastrophic failure of bolted-on HA.fencing มีอยู่เพราะ cluster แยกไม่ออกว่าเพื่อนโหนดตายจริงหรือแค่ติดต่อไม่ได้; ไม่มี fencing การแบ่งแยกเครือข่ายให้ primary สองตัวเขียนพร้อมกัน — ข้อมูลพัง; split-brain คือความล้มเหลวหายนะคลาสสิกของ HA แบบประกอบทีหลัง |
| S-6 | Two-node cluster guidance (Pacemaker 3.0 era)แนวทาง cluster สองโหนด (ยุค Pacemaker 3.0) | Two-node clusters — the only realistic factory-LAN shape — cannot form a quorum majority: they demand STONITH fencing hardware or a third witness node; three nodes is the recommended production baseline. Automatic failover on two nodes is the expensive, fragile configuration.cluster สองโหนด — รูปทรงเดียวที่สมจริงบน LAN โรงงาน — ตั้ง quorum เสียงข้างมากไม่ได้: ต้องมีฮาร์ดแวร์ fencing แบบ STONITH หรือโหนดพยานตัวที่สาม; สามโหนดคือฐานแนะนำของ production; failover อัตโนมัติบนสองโหนดคือ configuration ที่แพงและเปราะ |
| S-7 | Operational HA post-mortem literature ("STONITH deathmatch")วรรณกรรม post-mortem เชิงปฏิบัติการ ("STONITH deathmatch") | Misconfigured two-node HA can be less reliable than a single node — mutual-shooting loops, worst-case failover an order of magnitude beyond the quoted happy case. Automatic failover is not free reliability; it is a new failure surface that must be engineered and drilled.HA สองโหนดที่ config ผิดอาจเชื่อถือได้น้อยกว่าโหนดเดียว — วงจรยิงกันเอง, failover กรณีแย่สุดเกินตัวเลขที่โฆษณาเป็นสิบเท่า; failover อัตโนมัติไม่ใช่ความน่าเชื่อถือฟรี แต่คือพื้นผิวความล้มเหลวใหม่ที่ต้องออกแบบและซ้อม |
| S-8 | IIoT edge redundancy research (MDPI Sensors 2023; layered IoT HA surveys)งานวิจัย redundancy ของ edge IIoT (MDPI Sensors 2023; survey HA แบบชั้นของ IoT) | Industrial practice treats each tier's redundancy independently (device buffering, gateway aggregation, cloud zones) and validates a two-edge-device redundancy model as the extended posture — i.e., the industry norm is exactly a graded ladder from buffered single node to a redundant pair.แนวปฏิบัติอุตสาหกรรมแยก redundancy รายชั้น (buffer ที่อุปกรณ์, การรวมที่ gateway, zone บน cloud) และตรวจสอบโมเดล redundancy แบบ edge สองเครื่อง เป็นท่าขยาย — บรรทัดฐานอุตสาหกรรมคือบันไดไล่ระดับจากโหนดเดียวมี buffer ไปสู่คู่ redundant พอดี |
Every credible pattern for making a single-box gateway highly available — warm standby (S-1), Pacemaker active/passive (S-3), hypervisor clustering, cold spare with cloud-held config (S-4) — is layered around an unchanged application, provided the application already has three properties: one writer, a replayable write-ahead/event log, and clients that address a service rather than a machine. PROP-028's gateway has the first two by construction (G2 single allocator; the append-only event log with SyncCheckpoint). The standby node then consumes the same log stream the platform sync already consumes. Nothing about a future HA pair requires redesigning intake, stations, or the sync protocol — if and only if the six foundations of Section 6 are in the spec from the start.
ทุกแบบแผนที่น่าเชื่อถือในการทำ gateway กล่องเดียวให้พร้อมใช้สูง — warm standby (S-1), Pacemaker active/passive (S-3), clustering ระดับ hypervisor, เครื่องสำรองเย็นพร้อม config บน cloud (S-4) — ล้วนวางซ้อนรอบแอปเดิมที่ไม่เปลี่ยน หากแอปมีคุณสมบัติสามข้ออยู่แล้ว: ผู้เขียนเดียว, log แบบ replay ได้ (WAL/event log), และ client ที่เรียกหา service ไม่ใช่เครื่อง gateway ของ PROP-028 มีสองข้อแรกโดยโครงสร้าง (ผู้จ่ายเลขเดียว G2; event log แบบ append-only พร้อม SyncCheckpoint) โหนด standby ก็แค่บริโภค log stream เดียวกับที่การ sync ขึ้น platform บริโภคอยู่แล้ว HA pair ในอนาคตไม่ต้องออกแบบการรับอ้อย สถานี หรือโปรโตคอล sync ใหม่เลย — ก็ต่อเมื่อฐานรากหกข้อของข้อ 6 อยู่ในสเปกตั้งแต่แรก
The failure the literature warns about hardest (S-5, S-6, S-7) is precisely the one this gateway can least afford: a network partition or botched failover in which two nodes both believe they are the allocator. For a generic web app split-brain corrupts some rows; for the gateway it forks the per-mill-per-season delivery-ID sequence — the exact catastrophe A-35/G2 exists to make impossible by construction. Two conclusions follow:
ความล้มเหลวที่วรรณกรรมเตือนแรงที่สุด (S-5, S-6, S-7) คือสิ่งที่ gateway นี้รับไม่ได้ที่สุดพอดี: การแบ่งแยกเครือข่ายหรือ failover พลาดจนโหนดสองตัวเชื่อพร้อมกันว่าตนเป็นผู้จ่ายเลข สำหรับเว็บแอปทั่วไป split-brain ทำข้อมูลบางแถวพัง แต่สำหรับ gateway มันแตกแขนงลำดับเลขส่งมอบต่อโรงงานต่อฤดูกาล — หายนะที่ A-35/G2 ตั้งใจกันไว้ให้เป็นไปไม่ได้โดยโครงสร้าง ได้ข้อสรุปสองข้อ:
A factory server room realistically hosts two nodes, not three. Two-node automatic failover requires fencing hardware or a witness, must be drilled, and when misconfigured is less reliable than the single box it replaced (S-6, S-7). Meanwhile the simplest documented edge posture — a spare appliance plus buffering clients (the gateway ships as a platform-managed appliance per the PROP-028 OQ-1 decision, 19 Jul 2026) — recovers in tens of minutes at near-zero engineering cost (S-4, S-8). And an operator-attended manual promotion of a warm standby needs no fencing at all: the human is the quorum — which also happens to match the platform's existing two-act pattern (A-17) culturally. Automatic failover is the last rung of the ladder, not the first product.
ห้องเซิร์ฟเวอร์โรงงานตามจริงรองรับสองโหนด ไม่ใช่สาม failover อัตโนมัติแบบสองโหนดต้องมีฮาร์ดแวร์ fencing หรือโหนดพยาน ต้องซ้อม และถ้า config ผิดจะเชื่อถือได้น้อยกว่ากล่องเดียวที่มันมาแทน (S-6, S-7) ขณะที่ท่า edge ที่ง่ายที่สุดตามเอกสาร — appliance สำรอง + client ที่ buffer (gateway ส่งมอบเป็น appliance ที่ platform ดูแล ตามคำตัดสิน OQ-1 ของ PROP-028, 19 ก.ค. 2569) — กู้คืนในหลักสิบนาทีด้วยต้นทุนวิศวกรรมเกือบศูนย์ (S-4, S-8) และการเลื่อนขั้น warm standby แบบมีคนกดไม่ต้องใช้ fencing เลย: มนุษย์คือ quorum — ซึ่งพ้องกับแบบแผน two-act ของ platform (A-17) เชิงวัฒนธรรมพอดี failover อัตโนมัติคือขั้นสุดท้ายของบันได ไม่ใช่ product แรก
Every station client addresses the gateway by one stable LAN service identity (service name / virtual IP held by whichever node is active), with the gateway's TLS/station-registry identity attached to the service, not the hardware.
client สถานีทุกตัวเรียก gateway ด้วยตัวตนบริการเดียวที่คงที่บน LAN (service name / virtual IP ที่โหนด active ถืออยู่) โดยตัวตน TLS/ทะเบียนสถานีของ gateway ผูกกับ service ไม่ใช่ฮาร์ดแวร์
Retrofit cost if skipped:ต้นทุนถ้าข้าม: re-provisioning every station app at every gateway factory before any failover or even hardware swap can work — a fleet-wide field visit for what should have been one config line.ต้อง provision แอปสถานีใหม่ทุกตัวทุกโรงงานก่อน failover หรือแม้แต่การสลับฮาร์ดแวร์จะทำงานได้ — งานภาคสนามทั้ง fleet แลกกับสิ่งที่ควรเป็น config บรรทัดเดียว
The gateway database is a single-writer engine with physical log replication (the platform standard is already PostgreSQL per A-43 — warm standby is then pure configuration, S-1), and every number-space allocation commits inside a database transaction, never in application memory.
ฐานข้อมูล gateway เป็น engine ผู้เขียนเดียวที่มี physical log replication (มาตรฐาน platform คือ PostgreSQL อยู่แล้วตาม A-43 — warm standby จึงเป็น configuration ล้วน, S-1) และการจ่ายเลขทุกปริภูมิ commit ในทรานแซกชันของฐานข้อมูล ไม่ใช่ในหน่วยความจำแอป
Retrofit cost if skipped:ต้นทุนถ้าข้าม: an in-memory or file-based allocator has no standby story at all — the whole persistence layer gets rebuilt before HA can even begin.ผู้จ่ายเลขแบบ in-memory หรือไฟล์ไม่มีเส้นทาง standby เลย — ต้องสร้างชั้น persistence ใหม่ทั้งหมดก่อน HA จะเริ่มได้
GatewayNode carries a monotonic, platform-registered allocator epoch; it increments on every activation event (fresh install, restore from backup, standby promotion) and stamps every allocated ID batch, event-log segment and SyncCheckpoint. The platform (and any standby) rejects overlapping epochs — a forked allocator becomes detectable and non-ingestable by construction, closing the split-brain hole without fencing hardware (Finding 2).
GatewayNode ถือ allocator epoch แบบเพิ่มทางเดียวที่ลงทะเบียนกับ platform; เพิ่มขึ้นทุกเหตุการณ์ activation (ติดตั้งใหม่ กู้จาก backup เลื่อนขั้น standby) และประทับทุกชุดเลขที่จ่าย ทุก segment ของ event log และทุก SyncCheckpoint; platform (และ standby ใด ๆ) ปฏิเสธ epoch ที่ทับซ้อน — ผู้จ่ายเลขที่แตกแขนงถูกตรวจจับและนำเข้าไม่ได้โดยโครงสร้าง ปิดรู split-brain โดยไม่ต้องใช้ฮาร์ดแวร์ fencing (ข้อค้นพบ 2)
Retrofit cost if skipped:ต้นทุนถ้าข้าม: a sync-protocol and station-build breaking change across the deployed fleet — the one thing G3 promised would never be needed.การเปลี่ยนแบบ breaking ของโปรโตคอล sync และ build สถานีทั้ง fleet ที่ deploy แล้ว — สิ่งเดียวที่ G3 สัญญาว่าจะไม่มีวันจำเป็น
Mandated local backup cadence + a documented cold-restore procedure onto a replacement appliance, with published default targets per tier (Section 7). Station store-and-forward buffers (PROP-031 OQ-5) bound the intake-fact RPO near zero: on restore, stations replay what the dead gateway never wrote; only allocation stands still (Finding 2).
กำหนดรอบ backup ท้องถิ่น + ขั้นตอนกู้เย็นลง appliance ทดแทนที่มีเอกสารชัด พร้อมเป้าหมายเริ่มต้นรายชั้นที่ประกาศ (ข้อ 7) buffer แบบเก็บ-แล้ว-ส่งของสถานี (PROP-031 OQ-5) กด RPO ของข้อเท็จจริงการรับอ้อยลงใกล้ศูนย์: เมื่อกู้เสร็จ สถานี replay สิ่งที่ gateway ตัวตายยังไม่ได้เขียน มีเพียงการจ่ายเลขที่หยุดนิ่ง (ข้อค้นพบ 2)
Retrofit cost if skipped:ต้นทุนถ้าข้าม: the first mid-season disk death becomes an unbounded outage with data loss — and the business case of Section 6 of PROP-028 dies with it.ดิสก์ตายกลางฤดูครั้งแรกกลายเป็น outage ไร้ขอบเขตพร้อมข้อมูลหาย — และกรณีธุรกิจข้อ 6 ของ PROP-028 ตายตามไปด้วย
The gateway heartbeats on the LAN and to the platform; stations detect gateway-down and enter their specified posture — what buffers (weight readings), what hard-stops (all allocation), what stays readable (already the OQ-4 consistency flag vs PROP-031). This is needed for the base tier anyway, and it is the identical signal a future standby uses as its failover trigger.
gateway ส่ง heartbeat บน LAN และขึ้น platform; สถานีตรวจจับ gateway ล่มแล้วเข้าท่าที่ระบุไว้ — อะไร buffer (ค่าชั่ง) อะไรหยุดแข็ง (การจ่ายเลขทั้งหมด) อะไรยังอ่านได้ (คือธงความสอดคล้อง OQ-4 กับ PROP-031 อยู่แล้ว) ชั้นฐานต้องมีสิ่งนี้อยู่ดี และมันคือสัญญาณเดียวกันที่ standby ในอนาคตใช้เป็นตัวจุด failover
Retrofit cost if skipped:ต้นทุนถ้าข้าม: undefined station behavior during the first real outage — improvised on the yard at 2 a.m., then hardcoded wrong.พฤติกรรมสถานีไม่นิยามตอน outage จริงครั้งแรก — ด้นสดที่ลานตอนตี 2 แล้ว hardcode ผิด ๆ ต่อ
The gateway database is sealed: encrypted at rest with platform-held keys (delivered at boot through the gateway's platform registration, never stored beside the data), listening only inside the appliance (localhost/private socket), its sole credential machine-generated inside the gateway runtime. Nobody at the factory holds a database login — all read/write passes through the gateway's role-gated, logged APIs. Builds on the PROP-021 OQ-7 decided inputs (encryption at rest, lockdown, vendor-controlled login); made airtight by the 19 Jul 2026 OQ-1 decision — the gateway is a platform-managed appliance, so no third party holds root on the host. HA-compatible: the standby is a second sealed appliance consuming the encrypted replication stream over mutual TLS, keyed through the same platform channel at promotion.
ฐานข้อมูลของ gateway ถูกผนึก: เข้ารหัสขณะจัดเก็บโดยกุญแจอยู่กับ platform (ส่งมอบตอน boot ผ่านการลงทะเบียน gateway กับ platform ไม่เก็บคู่กับข้อมูล) ฟังเฉพาะภายใน appliance (localhost/private socket) credential เดียวถูกสร้างโดยเครื่องภายใน runtime ของ gateway ไม่มีใครในโรงงานถือ login ของฐานข้อมูล — การอ่าน/เขียนทั้งหมดผ่าน API ของ gateway ที่กันตามบทบาทและบันทึก log ต่อยอดจากข้อมูลตั้งต้นที่ตัดสินแล้วของ PROP-021 OQ-7 (เข้ารหัสขณะจัดเก็บ ล็อกดาวน์ ล็อกอินที่ผู้พัฒนาควบคุม); แน่นหนาสมบูรณ์ด้วยคำตัดสิน OQ-1 (19 ก.ค. 2569) — gateway เป็น appliance ที่ platform ดูแล จึงไม่มีบุคคลที่สามถือ root บนเครื่อง เข้ากันได้กับ HA: standby คือ appliance ผนึกตัวที่สองที่บริโภค replication stream ที่เข้ารหัสผ่าน mutual TLS รับกุญแจผ่านช่องทาง platform เดียวกันตอนเลื่อนขั้น
Retrofit cost if skipped:ต้นทุนถ้าข้าม: key custody and access paths harden badly after data exists — re-encrypting a deployed fleet mid-season, rotating exposed credentials, and unwinding any factory-side integration that grew against direct database access.การถือกุญแจและเส้นทางเข้าถึงแข็งทีหลังได้ยากเมื่อมีข้อมูลแล้ว — เข้ารหัส fleet ที่ deploy แล้วใหม่กลางฤดู หมุน credential ที่รั่วไหล และรื้อการเชื่อมต่อฝั่งโรงงานที่งอกมาจากการเข้าถึงฐานข้อมูลโดยตรง
| Tierชั้น | Postureท่า | Indicative targetsเป้าโดยประมาณ | Shipsส่งมอบ |
|---|---|---|---|
| A-0 | Single node + F-1…F-6; cold restore from backup onto a replacement appliance.โหนดเดียว + F-1…F-6; กู้เย็นจาก backup ลง appliance ทดแทน | RTO hours (hardware-bound) · intake-fact RPO ≈ 0 via station buffers · master-data RPO = last sync.RTO หลักชั่วโมง (ขึ้นกับฮาร์ดแวร์) · RPO ข้อเท็จจริงรับอ้อย ≈ 0 ผ่าน buffer สถานี · RPO ข้อมูลหลัก = sync ล่าสุด | Base tier, day one — in the initial spec.ชั้นฐาน วันแรก — อยู่ในสเปกฉบับแรก |
| A-1 | Cold spare: pre-staged spare appliance; operator swap + restore.สำรองเย็น: appliance สำรองเตรียมไว้; operator สลับ + กู้ | RTO tens of minutes.RTO หลักสิบนาที | Ops/kit option (S-4 pattern) — no software change.ตัวเลือก ops/ชุดอุปกรณ์ (แบบแผน S-4) — ไม่แก้ software |
| A-2 | Warm standby: streaming replication to a second node; operator-attended two-act promotion (A-17 pattern) — the human is the quorum, no fencing hardware.warm standby: streaming replication สู่โหนดที่สอง; เลื่อนขั้นแบบ two-act มีคนกด (แบบแผน A-17) — มนุษย์คือ quorum ไม่ต้องมีฮาร์ดแวร์ fencing | RTO minutes · RPO seconds (async window, S-1).RTO หลักนาที · RPO หลักวินาที (หน้าต่าง async, S-1) | The "HA pair" premium line item of OQ-4/OQ-6 — configuration + ops runbook on the F-1…F-5 substrate.รายการ premium "HA pair" ของ OQ-4/OQ-6 — configuration + runbook บนฐาน F-1…F-5 |
| A-3 | Automatic failover: adds fencing/witness + drills (S-6, S-7).failover อัตโนมัติ: เพิ่ม fencing/พยาน + การซ้อม (S-6, S-7) | RTO sub-minute.RTO ต่ำกว่านาที | Only if a mill demands it and pays for it (PROP-035 H-2 family); possibly never.เฉพาะเมื่อโรงงานต้องการและจ่าย (ตระกูล H-2 ของ PROP-035); อาจไม่มีวันทำ |
| Revรุ่น | Dateวันที่ | Changesการเปลี่ยนแปลง |
|---|---|---|
| 0.1 | 19 Jul 202619 ก.ค. 2569 | Initial study (client request): HA-now vs HA-later for the gateway spec. Verdict: HA-ready, not HA-now — foundations F-1…F-5 into the initial spec; availability ladder A-0…A-3 defers the HA pair as the OQ-4/OQ-6 premium tier. Evidence base S-1…S-8.การศึกษาแรก (ตามคำขอลูกค้า): HA ตอนนี้ vs ทีหลัง สำหรับสเปก gateway ข้อสรุป: HA-ready ไม่ใช่ HA-now — ฐานราก F-1…F-5 เข้าสเปกฉบับแรก; บันไดความพร้อมใช้ A-0…A-3 เลื่อน HA pair เป็นชั้น premium ของ OQ-4/OQ-6 ฐานหลักฐาน S-1…S-8 |
| 0.2 | 19 Jul 202619 ก.ค. 2569 | Client session: +F-6 sealed datastore (encrypted at rest, platform-held keys, gateway-only DB access; third NFR candidate). PROP-028 OQ-1 decided the same session — the gateway is a platform-managed appliance (supersedes the installable image); ladder A-0/A-1 and body wording updated accordingly; internal section refs corrected.รอบลูกค้า: +F-6 ฐานข้อมูลผนึก (เข้ารหัสขณะจัดเก็บ กุญแจอยู่กับ platform เข้าถึงฐานข้อมูลได้เฉพาะ gateway; NFR เสนอตัวที่สาม) OQ-1 ของ PROP-028 ตัดสินในรอบเดียวกัน — gateway เป็น appliance ที่ platform ดูแล (แทน image ติดตั้งได้); ปรับบันได A-0/A-1 และถ้อยคำตัวเอกสาร; แก้เลขอ้างอิง section ภายใน |
| 0.3 | 19 Jul 202619 ก.ค. 2569 | APPROVED (client) together with PROP-028 (Rev 0.11): the study's verdict and foundations F-1…F-6 are endorsed as the availability posture of the gateway spec; foundations enter the NFR set at application; HA-pair (A-2) pricing rides PROP-039.อนุมัติแล้ว (ลูกค้า) พร้อม PROP-028 (Rev 0.11): รับรองคำวินิจฉัยและฐานราก F-1…F-6 เป็นท่าความพร้อมใช้ของสเปก gateway; ฐานรากเข้าชุด NFR ตอน apply; ราคา HA คู่ (A-2) ไปกับ PROP-039 |