A records.snap stat with a configuration variable's name aborts startup

Aberta
#14,181 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 2 dias

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
4/5
Tempo estimado
3-5 dias
Facilidade para iniciantes
48/100
Tipo de issue
Bug
Clareza
Claramente especificada
Status de atividade
Ativa
Stack de tecnologia
cpp
Domínio
backend

Direção de pesquisa

Start in src/records/RecCore.cc, especially register_record() around the assertion linked in the issue. Trace how RecReadStatsFile() restores snapshot records before registration, and distinguish records restored from the snapshot from records registered with the wrong kind. Reproduce with the described records.snap entry and verify that startup succeeds for the restored record while the assertion still catches an explicitly misregistered record.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

Bug Records

RecReadStatsFile() runs inside RecCoreInit(), before any record is registered, so every stat in records.snap is restored as a new record under its stored name and kind. When the name belongs to a configuration variable, the later registration of that variable finds the restored stat and stops at the release assertion in register_record() (RecCore.cc):

Fatal: src/records/RecCore.cc:75: failed assertion `REC_TYPE_IS_CONFIG(r->rec_type)`

To reproduce, write a records.snap whose one element is a well-formed RECT_PROCESS, RECD_INT record named proxy.config.diags.debug.enabled, with the current version bytes, into the runtime directory, then run traffic_layout info (or start traffic_server). Both abort with SIGABRT. This happens on current master and with #14147 applied: the record is a valid stat, so the reader has no reason to reject it.

Nothing ATS writes puts a configuration name in the snapshot, so this takes a hand-made or damaged file, or a stat that a plugin or an older release registered under a name that is now a configuration variable. It is release-asserted, so a Release build stops too.

The reader cannot reject this without knowing every configuration name, plugin ones included. The place to fix it is register_record(): a record that was only restored from the snapshot, and never registered, should take the kind it is now registered with instead of asserting. The assertion should still hold for a record that some code really did register as the other kind. That changes how every record is registered, not only restored ones, so it is kept out of #14147.

Found during review of #14147.

Linguagem predominante
C++
Estrelas
2k
Forks
903
Merge médio
4d 4h
PRs com merge (30d)
135

Preparar o ambiente

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de apache/trafficserver

Todas as issues de apache/trafficserver

Issues semelhantes

Mais issues de C++

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.