Hey 👋 In having a look through the docs I agree this isn't well documented.
Here is what is
documented - as is expected by the Singer Spec, we only capture state emitted by the Target (i.e. we do not yet try to intercept messages between Tap and Target
@fred_reimer). According to the spec, Targets should only emit State messages once records up to the bookmark have been persisted. As the note in the docs suggests however, some Targets will only emit a STATE message once
all records have been persisted, which can be problematic if interrupted. Anything built with the SDK will use periodic bookmarking by default, so that mostly applies to pre-SDK Targets.
In addition to storing Target state, Meltano does make an effort to pick up where a failed Target left off. It does this by updating the last completed state with any subsequent incomplete state (i.e. merging them). The code for this is actually in the SingerTap plugin definition,
here, which handles state preparation before launching the Tap.
Hope this helps 🙂 I have created an
issue in our doc cleanup
epic to note that state handling needs attention. We have docs improvements on our
roadmap for December, so this should improve soon 🚀