Repository navigation
di.torq.proc.segmentedtp: log memorybatch rows buffered at a roll - #154
Conversation
An update arriving past a period or day roll ran the roll before the next timer tick, so pubclear published buffered rows without writing them to a log. A process replaying the logs could not recover those rows. Flush the batch to the closing log as the first step of stpeoperiod, endofday and the chained endofperiod. The update that triggers a roll still goes to the new log. Add a standalone and a chained memorybatch peer to the tests, covering period and day rolls through an update and through the chained peer. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DIReview Summary0 critical | 1 warning(s) | 0 suggestion(s)
|
|
Tested against main. The suite passes, and removing the fix gives the 7 failures you listed. Needs changing
Worth including: Looks like this is an underlying issue in TorQ as well and the problem was ported over. A roll triggered by an update skips the timer step that adds
The overcount lasts until the next roll. With two more updates logged but not yet published, replaying Calling the mode's own timer step fixes both modes and drops the mode check: .stplg.flushbatch:{.stplg.ts[];}With this, the update-triggered case gives 2 / 2 and 1 / 1, the replay returns only Small The new |
Resolve the segmentedtp VERSION conflict with #152 as 0.3.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…roll defaultbatch had the same root cause as memorybatch. A roll triggered by an update skipped the timer step that adds tmpmsgcount to msgcount, so the closed log's stpmeta msgcount was too low and the new log's too high until the next roll. Replaying msgcount messages could then return rows not yet published. Call the active mode's own timer step, which covers every mode and drops the mode check. Add defaultbatch tests for period and day rolls through an update, covering the stpmeta count, the new log's count and replay. Note in segmentedtp.md that this differs from TorQ. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DIReview Summary0 critical | 0 warning(s) | 2 suggestion(s)
Suggestions
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
DIReview Summary0 critical | 1 warning(s) | 0 suggestion(s)
|
Thanks, all addressed in f16d153 and 47e23bb:
The update-triggered period roll now gives 2 / 2 and 1 / 1, matching your numbers. My rows use different symbols, so replay returns only The full suite passes. On the TorqX-POC data-capture-1 stack, I re-ran the burst across forced rolls: no rows lost, lvc1 recovered exactly, and logs matched the HDB on all four tables. The real 17:00 roll ran before these changes and hasn't been repeated, and a natural midnight roll is still untested. I've also merged main (a939d11), which only brought in #88, and the segmentedtp suite passes on the result. |
|
Thanks Aaron, all four addressed. Tested and the suite passes, approving. |
Title: di.torq.proc.segmentedtp: log memorybatch rows buffered at a roll
Summary
In
memorybatchmode, an update arriving past a period or day roll ran the roll before the next timer tick.pubclearthen published the buffered rows without writing them to a log, so they reached subscribers and the HDB but no log, and a process replaying the logs could not recover them..stplg.flushbatchnow runs the timer's write, publish and count step as the first step ofstpeoperiod,endofdayand the chainedendofperiod. Buffered rows go to the closing log, and the update that triggers a roll goes to the new log.segmentedtpgoes to 0.2.1.Testing
k4unit (
di.torq.proc.segmentedtp): 110 of 110 pass. Adds a standalone and a chainedmemorybatchpeer, covering period and day rolls through an update and through the chained peer. Run against the originalstplog.q, the same tests give 7 failures.TorqX-POC
data-capture-1stack, forced rolls. Same scenarios with and without the fix, on the same base commit:traderows missing from logsquoterows missing from logsverify.q eod2:orderslogs vs HDB differencetrade/quotelogs vs HDB differenceReal 17:00 hour roll, nothing forced, with the fix. Burst from 16:59:30 to 17:00:30:
tradeand 14949quoteburst rows sent, all logged once and all in the RDBtraderow 16:59:59.9965) and new logs only rows from 17:00 onNot covered
memorybatchon a full stack: unit tests only