Replies: 1 comment
-
|
Opened the issue #4414 with this info, and just fixed. Please @tomscreen retry it with the latest |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Time-series data does not appear to replicate across HA/Raft nodes
Hi, I’m testing ArcadeDB time-series support in a 3-node HA/Raft setup and I’m seeing behaviour that suggests time-series samples are being written only to the node that receives the write, while schema/document/graph data replicates correctly.
I wanted to post this as a discussion first in case I’m missing configuration or intended behaviour.
Setup
26.5.1arcadedb.ha.enabled=truearcadedb.ha.clusterName=<cluster>arcadedb.ha.clusterToken=<token>arcadedb.ha.raftPort=2434arcadedb.ha.serverList=<node1-private-ip>:2434:2480,<node2-private-ip>:2434:2480,<node3-private-ip>:2434:2480Scenario Tested
I created a minimal time-series type on the current leader, based on the docs, for example:
CREATE TIMESERIES TYPE TestReading TIMESTAMP ts TAGS (deviceId STRING) FIELDS (value DOUBLE)The type definition replicated to the followers within a short period, so schema replication appears to be working.
Observed Behaviour
1. ILP write to leader
I wrote a sample via ILP to the leader.
Result:
2. ILP write to follower
I then wrote a sample via ILP to a follower.
Result:
This suggests ILP writes are accepted and stored locally on whichever node receives the request.
3. SQL INSERT sent to follower
I then sent a single time-series insert via SQL to a follower.
Result:
This suggests normal
/commandSQL writes on followers are being forwarded to the leader, which is expected for HA writes.4. SQL INSERT sent to leader
SQL insert sent directly to leader writes on the leader, but again the sample does not appear on followers.
File-Level Symptom
The time-series files also differ between nodes.
For example, after audit/login history writes:
Follower:
Leader:
So this does not appear to be only a query/read consistency issue; the local files differ.
Codebase Investigation / Hypothesis
From reading the ArcadeDB code, it looks like normal HA replication depends on
RaftReplicatedDatabaseinterceptingcommit()and submitting WAL changes through Raft.Relevant path:
ha-raft/src/main/java/com/arcadedb/server/ha/raft/RaftReplicatedDatabase.javaDatabaseInternaland interceptscommit()for Raft consensus./commandwrites are analysed and forwarded to the leader.For time-series writes, there seems to be a different path:
server/src/main/java/com/arcadedb/server/http/handler/PostTimeSeriesWriteHandler.javaTimeSeriesEngineengine.appendSamples(...)directlyengine/src/main/java/com/arcadedb/query/sql/executor/SaveElementStep.javaTimeSeriesEngine.appendSamples(...)engine/src/main/java/com/arcadedb/engine/timeseries/TimeSeriesShard.javaappendSamples(...)opens and commits its own nested transaction:database.begin()mutableBucket.appendSamples(...)database.commit()engine/src/main/java/com/arcadedb/schema/LocalTimeSeriesType.javainitEngine()constructs the engine fromschema.getDatabase():new TimeSeriesEngine((DatabaseInternal) schema.getDatabase(), ...)My suspicion is that the time-series engine may be holding or using the underlying local database rather than the HA/Raft wrapper, so the nested transaction commit does not go through
RaftReplicatedDatabase.commit().That would explain the observed behaviour:
There is also this comment in
TimeSeriesSealedStore:That seems to imply the mutable
.tstbbucket pages are expected to replicate through the normal paginated component path, but in our test they do not appear to do so.Questions
TimeSeriesEngineneed to be initialised with the HA-wrappedDatabaseInternalrather than the underlying local database?Happy to turn this into a minimal reproducible issue if this behaviour is unexpected.
Beta Was this translation helpful? Give feedback.
All reactions