TT Lab
Get started
Learn Learning paths Courses

In Front of an Unfamiliar System

Leave a Record the Next Person Can Rerun

Continue in TT Lab

Goal

You leave what you investigated in a form the next person can rerun. You turn the four kinds you saw in the reading (the reproduction command, the ruled-out list, the measurements, the document to hand over) into real files.

In the last step, the grader plays the next person. It runs the reproduction command you wrote somewhere other than your shell and checks whether the same number comes out. The records that fail here are the most common records in the field — they run only at the writer's own seat.

Environment

/opt/app/flaky.py imitates a customer's quote API. It is not something to fix but something to reproduce.

mkdir -p /root/record
nohup python3 /opt/app/flaky.py > /tmp/flaky.log 2>&1 &
sleep 1
curl -s http://127.0.0.1:8001/health
GET /health    항상 200
GET /quote     일정 주기로 503 — 본문은 upstream pool exhausted
GET /counter   지금까지 받은 /quote 요청 수

Files to create

All of them go under /root/record/.

repro.sh       증상을 다시 일으키는 명령 하나. 사람 없이 끝나고 숫자만 출력한다
before.txt     측정값과 '어떻게 쟀는지'
ruled_out.md   지운 계층과 그 근거 명령
evidence.txt   실패 응답의 상태 코드와 본문 원문
runbook.md     이 증상이 다시 났을 때 첫 30분
handoff.md     넘기는 문서

Steps

  1. Create the working directory and bring up the target service.
  2. Write repro.sh. It calls /quote 20 times and prints only the number of non-200 responses. It must finish without asking anything.
  3. Write the result in before.txt, together with how many calls the value came from and what was called. If there is only a number, the next person cannot measure with the same yardstick.
  4. In ruled_out.md, write at least two layers you erased, together with the commands that served as evidence.
  5. In evidence.txt, leave the status code and the body of the failed response as they are, without summarizing.
  6. The grader runs repro.sh from a different directory, with no environment variables.
  7. In runbook.md, write the symptom, the commands to run, the criteria for judging, and where to go when stuck.
  8. In handoff.md, write the current state, the next step, what not to touch, and lines pointing to the files you left earlier.

Notes

Step 6 is the whole point of this lab. The directory you had cd'd into, a shell alias, a variable you had exported beforehand — if you rely on even one of the three, you fail there. Write data paths as absolute paths, and create the values you need inside the script.

The working directory and the target service

Create the working directory and bring up the target service.

Create /root/record and bring up /opt/app/flaky.py. Run it in the background and check that /health returns 200.

Pin the reproduction command down to one

Write repro.sh. It calls /quote 20 times and prints only the number of non-200 responses. It must finish without asking anything.

It calls 20 times and prints only the count of non-200 responses. It is simple if you receive only the code with curl -o /dev/null -w '%{http_code}' and count. It must finish even with nobody there, so do not include a statement that waits for input.

The measurement together with how it was measured

Write the result in before.txt, together with how many calls the value came from and what was called. If there is only a number, the next person cannot measure with the same yardstick.

If you leave only the number, the next person cannot measure with the same yardstick. Write in the same file how many times you called and which path you called.

The layers you erased and their evidence

In ruled_out.md, write at least two layers you erased, together with the commands that served as evidence.

Saying only 'I checked and erased it' is not enough. Without what you erased it with, the next person checks that layer again. That the service is alive can be seen with /health.

The failure evidence verbatim

In evidence.txt, leave the status code and the body of the failed response as they are, without summarizing.

'503 occurred' is a summary. You must leave the status code and the response body as they are so that the next person can tell whether they are looking at the same thing.

Rerun it in a different environment

The grader runs repro.sh from a different directory, with no environment variables.

The grader does cd /tmp, clears the environment variables, and then runs repro.sh. If you rely on relative paths or variables you exported beforehand, you fail here — that is the point of this lab.

The first 30 minutes when it happens again

In runbook.md, write the symptom, the commands to run, the criteria for judging, and where to go when stuck.

What customers reopen most often in a handoff document is the runbook. It is useful at dawn only if it has not an explanation but the commands to run and how to read the result.

The document to hand over

In handoff.md, write the current state, the next step, what not to touch, and lines pointing to the files you left earlier.

'What not to touch' is the item most often missing and most expensive in a handoff. And if you hand over only the documents and not the reproduction command, the next person starts over from scratch.