Applies to:
- Plan - Enterprise
- Deployment - Self-hosted
- Use case - Inspect btql_export cursor and pause state and register a replacement export with a service token
Summary
Export automations run under an internal project-scoped identity. The recordeduser_id is metadata and does not change the runtime credentials. Inspect the aggregated cursor summary with POST /brainstore/automation/get-cursors. The checks below do not establish a gap-free handoff.
What is happening
btql_export automations keep separate cursor state per automation and per storage segment. A deleted automation ID does not transfer its cursor to a new automation even if both use the same S3 export_path. For exports, the top-level status shortcut is not reliable. Pause state is returned under config.status and an omitted value means active.
Fix or suggestion
Register a replacement export
- Pause the existing automation. Update the complete automation config with
config.status: "paused". - Verify that
GET /v1/project_automation/{id}showsconfig.status: "paused". - Inspect the aggregated cursor summary with
POST /brainstore/automation/get-cursorsusingautomation_idandproject_id. The summary does not return individual per-segment cursor values. - Wait for any inflight exports to finish. An unchanged cursor summary is not proof that none are running.
- Use a service token to authenticate creation of the replacement automation with
config.status: "paused". - Register the replacement with
POST /brainstore/automation/reset-cursors, passing itsautomation_id,object_id: "project_logs:<project_id>", and the intendedstart_xact_id. - Inspect the replacement’s aggregated cursor summary with
POST /brainstore/automation/get-cursorsbefore activation. - Activate the replacement by updating its complete config with
config.status: "active".
S3 checkpoint limitation
Do not use the largest_xact_id in S3 as a guaranteed gap-free handoff boundary. It may not represent a complete checkpoint across segments.
How to confirm it worked
- Review the replacement’s Export status dialog to confirm successful runs.
Notes
- Specify
start_xact_idwhen setting a starting position. Omitting it resets the starting value to zero. - Restarting from an earlier position can write overlapping rows alongside existing files in the export path.