Pick the fix
You deleted field 4 (discount) from a protobuf message. What else must you do?
Hint 1 of 1
What would an old client think a new field 4 is?
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Mark 4 (and the name) as reserved so it's never reused
Correct. Reusing the number would make old data decode as the wrong field.
Protobuf identifies fields on the wire by number, not by name. Reserving a deleted number and name stops someone reusing it later for a different field that old readers would decode wrongly.
Why not the others?
- B Renumber the remaining fields to close the gap. Renumbering breaks every existing client.
- C Nothing; protobuf ignores missing fields. True for reading, but a future field 4 would be misread by old clients.
- D Bump the package version. Doesn't stop field-number reuse.