apache/gravitino

[Improvement] Lance partition statistics drop API reports success even when nothing is deleted

Open

#10.620 aperta il 1 apr 2026

Vedi su GitHub
 (1 commento) (0 reazioni) (1 assegnatario)Java (887 fork)auto 404
good first issueimprovement

Metriche repository

Star
 (3058 star)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

What would you like to be improved?

When Gravitino is configured to use org.apache.gravitino.stats.storage.LancePartitionStatisticStorageFactory for partition statistics storage, dropping partition statistics can return success even if no statistics were actually removed.

In LancePartitionStatisticStorage.java, dropStatistics(...) always returns 1 as a placeholder:

That value is later converted to a boolean in StatisticManager.java, where != 0 becomes true, and the REST API returns DropResponse(true).

This means clients can get a successful drop result even when:

  • the target partition does not exist
  • the statistic name does not exist
  • nothing was actually deleted

How should we improve?

Do not return a hard-coded success count from the Lance backend.

Possible fixes:

  • Change the Lance dropStatistics(...) contract so it returns an accurate deleted count.
  • If Lance cannot provide counts, change the higher-level API to avoid interpreting a placeholder count as success.
  • As a safe short-term fix, have the Lance path return 0 only when the request is empty and otherwise explicitly verify whether matching rows existed before deletion, then return a real count or a trustworthy boolean.

Guida contributor