apache/gravitino

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

Open

#10,620 创建于 2026年4月1日

在 GitHub 查看
 (1 评论) (0 反应) (1 负责人)Java (887 fork)auto 404
good first issueimprovement

仓库指标

Star
 (3,058 star)
PR 合并指标
 (PR 指标待抓取)

描述

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.

贡献者指南