records.snap version check ignores the major version once it has two digits
Maintainer antworten meist innerhalb von 2 Tagen
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 3/5
- Geschätzter Aufwand
- 1-2 Tage
- Anfängerfreundlichkeit
- 57/100
Rechercherichtung
Start with RecFile.cc and P_RecCore.cc, especially the RecSnapFileWrite() and CheckSnapFileVersion() locations linked in the issue. Trace how the five-byte header is written and checked, then review the version constants and snapshot reader behavior. Done means snapshots from incompatible formats are rejected while compatible releases keep the intended persistent stats.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
RecSnapFileWrite() starts records.snap with five version bytes, 'V', PACKAGE_VERSION[0], PACKAGE_VERSION[2], PACKAGE_VERSION[4] and '\0' (RecFile.cc). At startup CheckSnapFileVersion() compares the same three characters and removes the file when they differ (P_RecCore.cc).
The check was added when the major version had one digit, so those characters were major, minor and patch: 9.2.5 writes 9, 2, 5. With a two-digit major they are the first digit of the major and two dots. 10.2.1 and 11.0.0 both write 1, ., ., so every 10.x and 11.x release accepts a snapshot written by any other, and the file is never removed on an upgrade between them.
No harm today: the RecRecord layout that the snapshot stores has not changed since 10.2.1. Once it changes, an 11.x server will read records written with the old layout, and only the reader's own bounds and type checks (added in #14147) stand between those bytes and the restore. Those checks keep the reader inside the buffer, but they cannot tell that a field moved, so a stat could come back with a wrong value.
A fix would compare what actually identifies the format. Two options that keep the five-byte header:
- Write the major, minor and patch numbers as byte values (
TS_VERSION_MAJOR,TS_VERSION_MINOR,TS_VERSION_MICRO) instead of characters of the version string, and compare all three. A file from a release with the old encoding then differs and is removed once, on the upgrade. - Write a snapshot format number that is bumped whenever
RecRecordor the message layout changes, so a patch release does not throw away persistent stats for nothing.
Comparing the whole PACKAGE_VERSION string would also work, but needs a longer header.
Raised by Damian (brbzull0) in review of #14147.
- Vorherrschende Sprache
- C++
- Sterne
- 2k
- Forks
- 903
- Ø Merge
- 4 T. 4 Std.
- Gemergte PRs (30 T.)
- 135
Entwicklungsumgebung
- Kein Dockerfile und keine Docker-Compose-Datei
- Keine Pull-Request-Vorlage
- Beitragsleitfaden lesen
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus apache/trafficserver
-
UnixNetVConnection::do_io_write with a null reader leaves the previous reader in the write VIOEvtl. vergeben @NginxL hat das heute übernommen. OffenBug Good First Issue IOBuffer Network
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/trafficserver#14220 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
MallocAllocator does not check for allocation failureEvtl. vergeben @umrndem hat das heute übernommen. OffenBug Core Good First Issue
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/trafficserver#14218 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 2 Tagen
-
Bug Event System Threads
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
apache/trafficserver#14217 ·
Maintainer antworten meist innerhalb von 2 Tagen
-
TSContScheduleEveryOnPool and TSContScheduleEveryOnThread accept a zero or negative periodEvtl. vergeben @rajeetvk hat das vor 1 Tag übernommen. OffenBug Event System Good First Issue TS API
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
apache/trafficserver#14214 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
-
HostDBContinuation::init memsets a polymorphic ActionEvtl. vergeben @ANMOLSCRIPT hat das heute übernommen. OffenBug Good First Issue HostDB
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
apache/trafficserver#14204 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 2 Tagen
Alle Issues in apache/trafficserver
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
Maintainer antworten meist innerhalb von 2 Tagen
-
bug data-types
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 76/100
ClickHouse/clickhouse-cpp#645 ·
Maintainer antworten meist innerhalb von 1 Tag
-
bug compatibility difficulty:easy prio:normal
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
NatronGitHub/openfx-misc#524 ·
Maintainer antworten meist innerhalb von 1 Tag
-
documentation enhancement help wanted P0
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Awesome-Embedded-Learning-Studio/Tutorial_AwesomeModernCPP#359 ·
Maintainer antworten meist innerhalb von 1 Tag
-
Type: Bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 82/100
openscad/openscad#7360 · 2 Kommentare ·
Maintainer antworten meist innerhalb von 1 Tag