hist_backfill_fixes: working-around (some) conc issues in the tsdb backfiller #62
Loading…
Reference in New Issue
There is no content yet.
Delete Branch "hist_backfill_fixes"
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?
A bunch of first-draft implementation and reorg work around some long lingering backfiller bugs/issues which seem to have been introduced as part of moving to our
.parquet-file backed default/builting tsdb per, colloquially dubbednativedb.I haven’t gone into much detail here about the fairly large set of changes since the explanation(s) will come in the follow up #75. We are landing this now since there are some subtle backfiller fixes which seem to resolve the most obvious issues (using mostly workarounds for now, unfortunately).
The very quick hi-level splanation is,
.tsp.__init__content ->.tsp._history.ui._remote_ctl) for charts to include morepyqtgraph-graphics-type parameter passing and more endpoints to support all of arrows, txt-labels and rects..ui._editors.ArrowEditoras needed..data._sharedmemAPI for offline usage from non-owning, non-actor script processes..storage.cli.markup_gaps()-> new.tsp._annotate..tsp._annotate.humanize_duration()for time-gap txt labeling content..tsp._dedupe_smart(written byclaudebased on my heuristic-logic) to better de-duplicate real-time written bars versus differing versions from provider history..ui._style.get_fonts()for retrieving the dpi-aware instances.claudewrote for itself to be able to grok a human dev’s experience introspecting crashes frompdb.pexpectas a dev dep.xonshrelease for @goodboy’s prompt injection needs.Before landing,
piker.tsp._historysubsys (and friends) namely for,piker store delete <fqme>)piker store ls) where bothpiker chartandpikerdwere cancelled “gracefully” (using the normal ctl-c from console) and/or when the host lost it’s network connection/crashed/was-purposely-killed by the sys (say using `kill -SIGKILL $(pgrep -f pikerd).In follow through,
Follow-up-todos from GH,
-> also now moved to #75
79eb8a1684tod147bfe8c49ebb977731tocd6bc105deChange annot-ctl APIs to return `None` on failure instead of invalid `aid`s. Server now sends `{'error': msg}` dict on failures, client match-blocks handle gracefully. Also, - update return types: `.add_rect()`, `.add_arrow()`, `.add_text()` now return `int|None` - match on `{'error': str(msg)}` in client IPC receive blocks - send error dicts from server on timestamp lookup failures - add failure handling in `markup_gaps()` to skip bad rects (this commit msg was generated in some part by [`claude-code`][claude-code-gh]) [claude-code-gh]: https://github.com/anthropics/claude-codee937b60ed6to62e9c74377hist_backfill_fixes: solving conc issues in the tsdb backfillerto WIP: hist_backfill_fixes: solving conc issues in the tsdb backfillerWIP: hist_backfill_fixes: solving conc issues in the tsdb backfillerto hist_backfill_fixes: solving conc issues in the tsdb backfiller62e9c74377toa97f6c8dcf-> I think this one was expected, so i used github link.
Caused by: Distribution not found at: file:///home/momo/Downloads/tractor
-> also with this command i got some warnings for tractor: piker store ls . expected warnings. [piker]$ piker store ls btcusdt.spot.binance btc.usdtm.perp.binance
-> piker store delete btcusdt.spot.binance
[piker]$ piker store delete btcusdt.spot.binance ->Then when did this: piker chart btcusdt.spot.binance there was no time gaps.
-> ctrl c and [piker]$ kill -9 $(pgrep -f “piker chart”) both worked, i had this: [10] > /home/momo/Downloads/piker/piker/tsp/_history.py(209)maybe_fill_null_segments() -> import greenback (Pdb+)
i dont know if i forgot to install dev dependencies, or the gap detection logic found actual gaps and triggered the fill routine (which needs greenback) , it comes from : maybe_fill_null_segments() )
Yup.. i just put up a commit to fix.. 🤦
I also just added
'repl'to the default deps groups in that last commit which should hopefully resolve this.Yeah I just did one more round of testing on both ib and binance and i think landing this definitely doesn’t make things worse XD
I’m going to finish/move a couple of the bullets above and then land this puppy.
@ -0,0 +1,306 @@# piker: trading gear for hackersAhh yeah, prolly worth noting that though it’s not documented yet, this is a a new
.tspmod which provides a bunch of new functionality for annotating time-gaps via a remote API started a while back when i first started digging into time-gap issues in the backfiller during thenativedbfirst-draft.I’m not going to go through everything in detail here since it’s all going to be much more refined and formalized in #75 (and follow up).
@ -0,0 +1,256 @@#!/usr/bin/env pythonAhh right and this is an “offline REPL runner” script
claudewrote for itself to be able to grok a human dev’s experience introspecting crashes frompdbsince apparently it can’t actually allow TTY takeover by such tools (and/or can’t sub-spawn one inside it’s process tree..)This prolly should be better refined as well once we have
claudemore integrated in our workflow.@ -28,1435 +28,25 @@ Historical TSP (time-series processing) lowlevel mgmt machinery and biz logic fostored offline (in a tsdb).'''from __future__ import annotationsNote this large change is just moving content to a new
.tsp._history.@ -0,0 +10,4 @@from ._anal import with_dtsdef dedupe_ohlcv_smart(Using a heuristic for which bar(s) are likely most correct given known race conditions around OHLCV sampling under real-time-write usage.
hist_backfill_fixes: solving conc issues in the tsdb backfillerto hist_backfill_fixes: working-around (some) conc issues in the tsdb backfiller@ -194,0 +198,4 @@# to get fancy next-cmd/suggestion feats prior to 0.22.2 B)# https://github.com/xonsh/xonsh/pull/6037# https://github.com/xonsh/xonsh/pull/6048xonsh = { git = 'https://github.com/xonsh/xonsh.git', branch = 'main' }hmm, could prolly just pin this to latest release here?
yup did it.