Chapter 23 · Course 3 c23-m03
How do we diagnose an unknown failure?
Your goal Diagnose a reappearing row with hypotheses, logs, and measures, then verify a safe repair.
The lesson, the vocabulary, the worked example and the mission are separate blocks. You can follow them in order or return to the one you need.
Video explanation
This English explanation has English subtitles. Its examples may use a separate practice dataset; use the data stated in the written mission for your answers.
Story · optional context
The story so far
You are Aster Motors' data recruit. Luca was hurt when a shell resembling Noctis 01 crashed; the prototype was later found and investigators examine payments and insurance. A false authorization in your name was added and then deleted from the register. After Voss's personal access was revoked, the line reappeared in the view. Noor preserved the replay's P0/42 log. Imani found REQ-27, a request attributed to Voss before his trip to schedule REPLAY-6; its signature needs verification. One technical question remains: is the reappearance a new database write, a replay, or a display fault?
This lesson stands alone. Diagnosis starts with several hypotheses and looks for observations that distinguish them without changing original evidence. Compare visible-row source positions, recent database changes, and CDC stream health. In a fictional copy, clues support replay of an old message; then check that a repair removes the current line while keeping the original log.
Before the lesson
Purpose of this course
Diagnose a reappearing row with hypotheses, logs, and measures, then verify a safe repair.
Topics covered
State at least three possible causes before changing the service.; Compare source IDs, new writes, and CDC health.; Test the leading hypothesis on a copy while preserving traces.; Verify the repaired view separately from the evidence archive.
What you will learn
- State at least three possible causes before changing the service.
- Compare source IDs, new writes, and CDC health.
- Test the leading hypothesis on a copy while preserving traces.
- Verify the repaired view separately from the evidence archive.
PART 1 · THE LESSON
Understand step by step
Lesson · explanation
Start with the question, not the repair
You work at Aster Motors. Luca was injured in a shell resembling the Noctis 01 prototype. A false authorization in your name was added to the register, deleted, and then visible again at 03:10. Noor preserved P0/42 from a process called REPLAY-6. Imani holds REQ-27, a request attributed to Voss whose signature still needs checking. This lesson asks a technical question: where did the returning row come from? You need no previous chapter to answer it.
Diagnosis is an investigation into the cause of a problem. It resembles finding why a lamp will not turn on. The bulb might be broken, the switch off, or the outlet unpowered. Immediately replacing the bulb could help by luck, but would not show what happened. For a data row, an equally rushed fix could hide the cause and damage logs Imani needs.
The goal is to write possible explanations, identify an observation each predicts, and test safely on a copy. Three starting ideas suffice: a new database write, an old message republished by replay, or a display fault that makes one row appear twice. At the end, verify two separate outcomes: the current view is correct and historical evidence remains readable.
AUTH-9, P0/42, and CDC are fictional identifiers in this simulation. AUTH-9 is the disputed authorization; P0/42 is a source-message position; CDC is a stream reporting database changes. No real account or Luca's medical data are touched. The scene is urgent only within the story. Read the clues and repeat the comparisons at your own pace.
Pause and think
Why list several causes before changing the view?
See the explanation
The same visible row may arise from different mechanisms; choose tests that separate them without damaging evidence.
Lesson · explanation
Write three hypotheses with different predictions
A hypothesis is an explanation to test, not an announced fact. H1 says a new AUTH-9 row was written to the database at 03:10. If H1 is true and change capture works, expect a new CDC write event. H2 says REPLAY-6 resumed an old P0/42 message and sent it into the view again. Expect the same source position on both appearances. H3 says only the display cache duplicated the row; the actual output log should contain one publication.
Imagine seeing three identical-looking paper images on a desk. They might come from three print jobs, one old sheet copied twice, or a mirror that makes a single sheet look doubled. The visible image count does not settle the cause. Check the printer log, paper identifier, and actual desk. For data, the database, message stream, and display are the places to inspect.
Make a small diagnostic table before the experiment. Column one names the hypothesis, column two the trace it predicts, and column three a trace that weakens it. A new CDC write supports H1. A repeated P0/42 position without a new database write supports H2. One output-log publication but two lines on screen supports H3. Other causes may exist; these three are a useful start, not a complete list of every possible fault.
REQ-27 mentions REPLAY-6, but it does not replace the table. Until its signature is authenticated, it cannot be a shortcut for naming a person. Even an authenticated request would address who prepared the task, not directly whether today's displayed line came from a new write, replay, or cache. Keep the technical mechanism separate from human attribution.
Pause and think
What trace would support the display-cache hypothesis?
See the explanation
Two visible rows but one real publication in the output log, with no new source message.
Lesson · explanation
Read source positions without confusing appearances and origins
In the practice copy, AUTH-9 appears at 21:35 and again at 03:10. Both appearances carry exactly P0/42. A source position is like a page number in a message notebook: reading page 42 again does not create page 43. The shared position suggests that one old message was processed a second time. It supports H2, but still check whether a program transformed the message and whether the database received an independent write.
Compare row identifiers, source positions, event times, and publication times. Two publication times may describe two passes of the same message through a program. They do not prove that a person performed the action twice. A common trap is counting two screen lines and saying two authorizations were signed. Publications of a view and actions at the source are different quantities.
Next check the CDC log. It shows no new authorization write after deletion in the simulation, while its health test passes and its position advances normally. That weakens H1. If CDC were stopped or stuck, silence would say little: a silent mail carrier cannot prove no letter was sent. Check that the messenger functions before using the absence of messages as evidence.
Finally compare the page with the output log. If the log really records two publications from P0/42, a simple display mirror H3 explains the evidence poorly. Replay of an old source message becomes the best explanation for this copy. Write 'best supported by available observations,' not 'certain forever.' Another log may reveal another factor, and a useful diagnosis remains open to revision.
Pause and think
Why does no new CDC event prove little if the connector is down?
See the explanation
A stopped connector can miss a real write; verify health and progress before interpreting silence.
Lesson · explanation
Reproduce the fault on a copy that protects evidence
Noor first preserves the faulty view, REPLAY-6 logs, a copy of P0/42, source positions, and register versions. An experiment that overwrites them would remove clues from the investigation. On a fictional copy she processes P0/42 once and then again. Without a duplicate guard, AUTH-9 reappears in the view; with the guard, the second pass is recognized as already processed. The experiment compares a possible cause with observed behavior without launching REPLAY-6 in production.
A test copy resembles a model electrical circuit. You can disconnect a wire in the model to understand its fault, but not shut down a hospital's wiring for a lesson. The same rule applies here. Originals stay protected, while every test states which version and messages it used. Another person should be able to repeat it and obtain the same counts; otherwise the demonstration resembles a trick rather than a diagnosis.
Deduplication means preventing the same event from producing unintended repeated effects. A guard key may combine an identifier with source position P0/42. When processing sees that pair again, it knows it was already applied. Be careful: not every repetition is wrong. Two different purchases of the same amount may need two rows. The guard should identify the same event, not merely a similar value.
The trial supports H2 as a mechanism: republishing P0/42 can recreate the line, and the guard prevents it in this copy. It does not alone prove that Voss wrote the original false authorization. Nor does it authenticate REQ-27 before Imani checks its signature. A technical experiment answers one narrow question, which is useful enough: it shows where to place the guard and which part of the service needs repair.
Pause and think
Why not run REPLAY-6 in production just to see whether the row returns?
See the explanation
It could reintroduce the fault or alter evidence; reproduce on a controlled copy after preserving originals.
Lesson · explanation
Repair the current view while preserving readable history
A controlled repair follows a reviewed plan. It pauses uncontrolled replay, retains the faulty version and logs, rebuilds the current view from a protected source in which AUTH-9 has been deleted, and adds a guard against another P0/42 publication. The small exercise script that displays an empty repaired view illustrates the expected result only. It does not include every command or approval needed for a real intervention.
Distinguish current view from historical log. The view answers 'what should appear now?' The log answers 'what happened?' After repair, zero AUTH-9 in the current view is consistent if the post-delete source contains none. Yet P0/42, both observed appearances, the faulty version, and change events must remain readable for Imani. Deleting history to make the row disappear would be like tearing a page from a notebook to pretend the mistake never occurred.
Check other data too. A rebuild that removes AUTH-9 but also loses Luca's and Imani's legitimate access is not successful. Compare expected counts, IDs, and event links. Then, on a copy with approval, test restart and verify no new AUTH-9 appears. This second check distinguishes a page that looks clean for a minute from a durable correction of the processing path.
Record what was done and by whom: copy used, rule version, trial time, before and after output, approval, and preserved trace. The note lets Noor maintain the service and Imani understand what changed after her screenshot. Repairing a display need not rewrite the past. Keeping those two ideas separate is part of sound data engineering.
Pause and think
What two independent outcomes must be checked after repair?
See the explanation
AUTH-9 is absent from the current view, while historical logs including P0/42 remain intact and readable.
Lesson · explanation
Produce a diagnosis another team can challenge
For the 'ghost row' mission, begin your report with H1, H2, and H3 and each predicted trace. Then list observations: AUTH-9 appeared at 21:35 and 03:10, both appearances share P0/42, and a healthy CDC stream reports no new write in the practice copy. Add what the output log says. This organization lets Mara follow your reasoning even without reading earlier lessons.
Propose a test on a copy: reread P0/42 with and without deduplication, compare the resulting view, and retain all inputs. If the second pass creates the row only without the guard, the experiment supports replay. The proposed fix can then rebuild from post-delete data, add the guard, and include an authorized restart trial. Do not promise that merely deleting a row from a webpage fixes the process that republishes it.
The conclusion needs a limit. In the exercise copy, replay of P0/42 is the best technical explanation, rather than a fresh database write. This diagnosis alone cannot name the human who created the original false authorization or decide REQ-27's intent. Imani will compare an authenticated request, recovered prototype, financial records, and Luca's testimony in the broader investigation. Keep each person's role distinct.
If another team discovers tomorrow that CDC was actually stopped, reopen H1. A strong diagnosis says what new observations would change it. That is a strength, not weakness. The mission succeeds when hypotheses are testable, evidence is protected, the current view is repaired without erasing history, and someone else can repeat the checks. The next lesson presents this work in a professional portfolio.
Pause and think
What new information would make you reopen the new-write hypothesis?
See the explanation
A newly found CDC write event, or evidence that CDC was stopped when its silence was assessed.
Visual guide
Three causes, one safe test
- 1H1: new write → look for new CDC
- 2H2: replay → same P0/42 in both rows
- 3H3: display → compare view with source output
- 4Copy: same P0/42, healthy CDC, no new write → H2 supported
A hypothesis grows stronger when alternatives are tested and source health is checked.
Code · read each line
Compare clues on a copy
view=[
{"row":"AUTH-9","source":"P0/42","shown_at":"21:35"},
{"row":"AUTH-9","source":"P0/42","shown_at":"03:10"},
]
cdc_new_writes=[]
cdc_healthy=True
print("view_rows",len(view))
print("same_source_position",view[0]["source"]==view[1]["source"])
print("new_database_writes",len(cdc_new_writes))
print("cdc_healthy",cdc_healthy)
print("replay_hypothesis_supported",
view[0]["source"]==view[1]["source"] and not cdc_new_writes and cdc_healthy)
repaired_view=[] # rebuilt from the retained post-delete source on a copy
print("repaired_current_rows",len(repaired_view))
print("raw_log_preserved",True)Two rows share P0/42, fictional CDC is healthy with no new write. The script supports replay, shows empty current view after repair, and preserves raw logs.
PART 2 · WATCH IT WORK
A complete worked example
Follow each step, then the result
Worked example: two rows, one origin
AUTH-9 appears at 21:35 and 03:10 with P0/42 both times.
- Compare positions: they match, suggesting rereading.
- Look for a new database write and check CDC is running.
- On a copy, reprocess P0/42 and check deduplication behavior.
- After repair, check zero current rows but retain both historical observations.
Good diagnosis compares causes, tests safely, and verifies what must remain preserved.
How this helps with your missionThe worked example compares AUTH-9 at 21:35 and 03:10, both linked to P0/42. The shared position suggests rereading, and a healthy CDC stream with no new write weakens H1. A copy test with and without deduplication distinguishes mechanisms. In the mission, give H1 fresh write, H2 replay, and H3 cache, plus each predicted trace. Select H2 as best supported for this copy. Describe a reviewed repair and separately check zero AUTH-9 in the current view and preservation of P0/42. Human attribution remains an investigative question.
PART 3 · YOUR TURN
Use the lesson to solve the mission
Story scene · practical task
Mission: the ghost row
Voss says the new line proves a fresh authorization by you. Imani asks whether the database really changed; Noor protects logs before repair. Mara wants a diagnosis another team can repeat. The uncertainty is urgent in the story; the exercise has no timer.
Your task
- Write three hypotheses and the observation predicted by each.
- Compare the two P0/42 positions and healthy CDC log with no new write.
- Propose a safe test and controlled repair.
- Give two post-repair checks and an attribution limit.
How to know you have succeeded
- New write, replay, and cache distinguished.
- Same position and no new write with healthy CDC support replay.
- Copy test, preserved evidence, rebuilt view with deduplication.
- AUTH-9 absent from view, log preserved; human author not inferred.
Try code or SQL and keep a local draft. The mission questions are checked separately below.
See the worked answer
- H1 predicts new CDC; H2 predicts reused source position; H3 predicts mismatch between display and actual output.
- Both AUTH-9 rows carry P0/42; CDC is healthy and has no new write in the copy. That supports H2 without treating unchecked CDC silence as proof.
- Preserve faulty candidate and logs, reprocess P0/42 on a copy, add checked deduplication, rebuild current view from post-delete source.
- Verify zero current AUTH-9 and links for other facts; keep P0/42 and logs readable. Replay mechanism does not name the initial fraud author.
The returning row's mechanism is explained and traces remain. The final lesson brings together skills and case evidence for a technical defense before Imani's official conclusion.
Before you leave
Remember this
- Diagnosis compares hypotheses before changing the service.
- A new write, replay, and display fault predict different traces.
- Two appearances with P0/42 support rereading; CDC silence matters only when the stream is healthy.
- Reproduce on a copy with and without a duplicate guard after preserving the original evidence.
- Check a repaired current view without erasing historical logs.
- A technical mechanism alone does not name a human author or establish intent.
Continue with the integrated lessons
After the lesson and its mission, work through the additional lessons below in order. Each workshop supplies its own fictional data: do not merge identifiers or times from separate exercises into the story timeline.
Part of the lesson · keep nearby
New words, explained
These are the names of ideas used in the lesson above. Return here whenever a word feels unfamiliar.
- Hypothesis
- A possible explanation that observations can support or reject.
- Log
- Recorded sequence of facts from a program or database.
- Metric
- Observed number helping compare expected and actual operation.
- Replay
- Reading or publishing an existing message again.
- Source position
- A marker of a message's origin, here P0/42.
- CDC
- Stream of committed database changes.
- Safe test
- A trial on a copy or approved environment that leaves original evidence untouched.
- Post-repair check
- A check that the symptom is gone and important material remains.
Approfondissements de ce cours
Reconstituer une livraison de bout en bout
Pour diagnostiquer un échange complet, dessiner poste, switch, passerelle avec ou sans NAT, réseau intermédiaire et service. Préciser nom de service, adresse résolue, port, transport et protocole applicatif. Le livre utilisait une IP directe pour retarder l’étude du DNS ; aujourd’hui cette substitution peut changer le site choisi par l’hébergement virtuel, le certificat TLS ou le routage applicatif. Noter ces hypothèses avant de comparer deux essais.
Pour un échange HTTP sur TCP simple, le client prépare d’abord une connexion vers le port du service et reçoit un port éphémère local. L’établissement ordinaire échange SYN, SYN+ACK puis ACK avant les données applicatives dans notre modèle de base. La route détermine la sortie et le prochain saut, ARP résout ce voisin en IPv4 Ethernet si nécessaire, puis une trame porte le paquet et le segment. Un dump hexadécimal peut être lu par offsets ou avec Wireshark pour vérifier la relation entre les octets et les rubriques.
Le commutateur apprend la source et transmet en liaison. Le routeur reçoit la trame locale, extrait le paquet, contrôle l’en-tête et sélectionne la sortie. Sur un nouveau lien, les adresses MAC changent ; en IPv4 le TTL diminue et le checksum d’en-tête est ajusté même sans NAT. Si une traduction est configurée, l’adresse et éventuellement le port concernés changent aussi et l’état permet la traduction inverse. Franchir une limite privé/public n’implique pas automatiquement une règle NAT universelle ; c’est un choix de l’architecture.
Le serveur reçoit un paquet destiné à son adresse et un segment pour un service en écoute. Il peut accepter la connexion puis répondre ; un service fermé, une politique de filtrage ou une panne modifient ce scénario. Dans un exemple traduit, le serveur observe le port extérieur choisi par NAPT, pas forcément le port initial du client. La réponse parcourt son chemin puis est retraduite à la passerelle ; le client associe le segment à la bonne socket. Les valeurs répétées dans les schémas doivent rester cohérentes avant et après traduction.
Une fois le transport prêt, une requête HTTP/1.1 directe ressemble à GET /rapport.csv HTTP/1.1 suivi d’un champ Host, d’autres en-têtes éventuels et d’une ligne vide. Le format absolu montré dans l’ancien cours ne décrit pas toutes les formes de requête, notamment la distinction client direct/proxy. Sur HTTPS, TLS ajoute son établissement et sa protection ; avec HTTP/3, le transport repose sur QUIC. Le délai peut être de quelques millisecondes ou bien plus : distance, pertes, files, résolution et traitement métier influencent le temps réel.
Un proxy est un intermédiaire applicatif : il peut relayer, appliquer une politique, centraliser des accès et parfois mettre des réponses en cache selon leurs règles. Un reverse proxy reçoit les demandes pour les services publiés ; un proxy de sortie accompagne les clients. Les informations visibles, la validation des certificats et les journaux dépendent du montage. Un relais ne garantit pas l’anonymat, mais affirmer qu’il est toujours possible de retrouver une source serait également excessif. Pour une livraison sensible, documenter qui voit quelles données et quelles confirmations sont garanties.
À toi de jouer
Pourquoi deux captures du même échange peuvent-elles présenter des MAC différentes, un port source différent et un TTL différent ?
Voir la correction expliquée
Les captures peuvent être de part et d’autre d’un routeur avec NAPT : la liaison est reconstruite, la traduction peut changer le port et le transfert modifie le TTL. Vérifier les points d’observation avant d’affirmer qu’il s’agit de flux distincts.
Références : RFC1812 — routeursIPv4 · RFC9112 — HTTP/1.1 · RFC9000 — QUIC.
Adapté de Apprenez le fonctionnement des réseaux TCP/IP, Romain Guichard (Caelifer), elalitte, pages 179–188. Consulter le PDF source et ses illustrations · Provenance. Licence Creative Commons 6 2.0 (mention extraite de la couverture ; variante non identifiée)