Skip to content

it is easy if you know where to look - #5543

Merged
timvisee merged 1 commit into
devfrom
indexing-bug
Nov 28, 2024
Merged

timvisee merged 1 commit into
devfrom
indexing-bug

Conversation

@generall

Copy link
Copy Markdown
Member

What lessons should we learn from this bug?

  • Do test coverage?
  • Rely more on the pattern matching and force compiler to make sure all fields are used?
  • Do not access fields of the structure directly?

Comment on lines 249 to +251
entry.segment_index = segment_index;
entry.version = version;
entry.internal_id = internal_id;

@timvisee timvisee Nov 28, 2024 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify: here we mixed up internal IDs.

We bump the segment index from segment A to B, but we forgot to bump the internal ID for the point. They are not compatible.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This in place mutation field by field is very error prone indeed.

Can we validate this invariant with tests now?
Are there other places where we do something similar?

@timvisee timvisee left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hah, this is definitely a fun one. Fantastic find!

Merging directly so it's tested over night.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants