apache / apache/hugegraph

[Bug] Cassandra commitAsync lacks retry support after Cassandra restart

Open
#3,009 3 comments 0 reactions 0 assignees View on GitHub
bug cassandra
Dominant language
Java
Stars
3.2k
Forks
636
Avg merge
3d 11h
Merged PRs (30d)
14

Description

### Bug Type (问题类型)

logic (逻辑设计问题)

### Before submit

- [x] 我已经确认现有的 [Issues](https://github.com/apache/hugegraph/issues) 与 [FAQ](https://hugegraph.apache.org/docs/guides/faq/) 中没有相同 / 重复问题 (I have confirmed and searched that there are no similar problems in the historical issue and documents)

### Environment (环境信息)

- Server Version: 1.0.0 (Apache Release Version)
- Backend: RocksDB x nodes, HDD or SSD
- OS: xx CPUs, xx G RAM, Ubuntu 2x.x / CentOS 7.x
- Data Size: xx vertices, xx edges

### Expected & Actual behavior (期望与实际表现)

Follow-up from #2997 / #2740.

#### Code pointer:
https://github.com/apache/hugegraph/blob/836b34832b485df8b4cae02880a489ebc516cf6d/hugegraph-server/hugegraph-cassandra/src/main/java/org/apache/hugegraph/backend/store/cassandra/CassandraSessionPool.java#L237-L243

### Expected behavior

When Cassandra is temporarily unavailable or restarted, the Cassandra backend should handle transient connectivity failures consistently between synchronous and asynchronous write paths.

`CassandraSessionPool.Session.commit()` now uses `executeWithRetry()` and can retry transient failures such as `NoHostAvailableException`.

`commitAsync()` should either provide equivalent retry support for async writes, or explicitly define and document different reliability semantics.

### Actual behavior

`CassandraSessionPool.Session.commitAsync()` bypasses `executeWithRetry()` and calls Datastax `Session.executeAsync(...)` directly.

During a Cassandra restart, async writes issued through `commitAsync()` can fail with transient driver errors such as `NoHostAvailableException`.

The failure is only surfaced through the Datastax `ResultSetFuture` / `getUninterruptibly()` flow. Callers that do not inspect these futures carefully may miss failed async writes.

This creates inconsistent behavior:

```text
commit() -> executeWithRetry() -> transient retry support
commitAsync() -> executeAsync() -> no async retry support
```

### Vertex/Edge example (问题点 / 边数据举例)

```javascript

```

### Schema [VertexLabel, EdgeLabel, IndexLabel] (元数据结构)

```javascript

```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.