apache / apache/pinot

SegmentPurger does not handle schema evolution gracefully

Open
#6,334 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
6.1k
Forks
1.5k
Avg merge
1d 21h
Merged PRs (30d)
189

Description

We ran into an issue where SegmentPurger failed due to schema evolution as follows:

- New columns were added into the schema.
- Table index was updated to have inverted index on some of the newly added columns.
- An explicit backfill was not performed.

When the SegmentPurger tried to purge older segments, it failed with the following error:
`java.lang.IllegalStateException: Cannot create inverted index for column: because it is not in schema`

This is likely because SegmentPurger used the schema in the segment as opposed to the schema in the controller.
It would be desirable for SegmentPurger to gracefully handle this scenario.

Contributor guide

Open the contributing guide

Research direction

Start at SegmentPurger and trace how it chooses a schema when purging older segments; compare the segment schema with the controller schema in the reported schema-evolution case. Reproduce the added-column and inverted-index scenario without an explicit backfill, and consider the work done when purging completes without the reported IllegalStateException.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.