Skip to content

Datasets_ReingestDataset

POST
/v1/accounts/{account}/datasets/{dataset}:reingest
curl --request POST \
--url https://api.qualia.dev/v1/accounts/example/datasets/example:reingest \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <X-API-Key>' \
--data '{ "name": "example", "ingestConfig": "example", "mergedSettingsContext": { "mergedDataset": "example", "members": [ "example" ], "membershipRevision": "example", "etag": "example", "sourceCommit": "example" }, "requestId": "example", "resumeReingest": "example", "timeSyncPatch": true, "validateOnly": true, "members": [ "example" ], "membershipRevision": "example", "cancelMergedSync": true }'

Upload only (MCAP): commits a new meta/ingest.toml and ingests the unchanged recordings again under it, publishing the upload’s next generation. Returns once the work is admitted; the ingest takes minutes and is read with GetReingest. A config identical to the published one runs nothing and returns that publication, SUCCEEDED, with unchanged set.

A config that declares [episodes] spans re-cuts the recordings at those windows. Episode ids follow position, so a re-cut renumbers every episode of the upload: it is FAILED_PRECONDITION, naming the counts, while any episode holds a person ruling, a person issue or note, a reach result, an edit or a split child.

FAILED_PRECONDITION on a mixture, a non-MCAP upload, a merged dataset (unless validate_only: below) and an upload merged into one (naming it; its GetReingest and GetIngestReport still answer); INVALID_ARGUMENT when the config does not parse.

With time_sync_patch the config is a patch of the upload’s time sync, and the server keeps every other table of the published meta/ingest.toml.

A merged dataset has one time sync, which every upload it holds is to be processed to. ingest_config is the strict time sync patch of time_sync_patch (any other table is INVALID_ARGUMENT), composed onto each upload’s own published meta/ingest.toml, and membership_revision is required (ABORTED when the dataset’s uploads changed since it was read, in GetDataset’s sync_preparation). The answer is ReingestDatasetResponse.merged_sync.

With validate_only the call is the pre-check: it reads each upload’s published time sync, one at a time, and says which uploads already hold the patch, which would be re-processed and which cannot be, and why. It writes nothing and starts nothing.

Without validate_only the call applies it. In one transaction it stores the patch as the dataset’s time sync (replacing an earlier one), stores each upload’s composed config and standing, and records one DATASET_UPDATED on the dataset (path time_sync). It dispatches nothing itself: a background driver admits the uploads that wait as ordinary corrective re-ingests, the least recently touched first (an apply’s recordings start in membership order; one that met an outage or a refusal goes to the back), at most four per merged dataset running at once (QDS_MERGED_SYNC_MAX_RUNNING), each fenced on the head it was composed at. An upload that already holds the patch is never dispatched, and the same patch applied again dispatches nothing new. A failed upload is tried again by the driver up to three times; members applies again to the listed uploads only (the same patch as the dataset’s current time sync), which is Try again for an upload that failed or could not take it. Progress is read from GetDataset’s sync_preparation and each upload’s GetReingest.

Every upload appended to the dataset afterwards (MergeDatasets with merge_target) is brought to its time sync too: see MergeDatasetsResponse.reprocessed_uploads.

While uploads are still waiting, claimed or re-processing for the time sync, the dataset’s uploads cannot change: a Remove, a version, a version preview’s publication and the solver are FAILED_PRECONDITION naming the dataset and the number of recordings. They count the recordings waiting, claimed, re-processing, failed in a way the driver will retry, and BLOCKED only until another re-ingest of them ends (waiting_on_operation_id set); leftovers (failed for good, blocked for what they hold, NOT_APPLICABLE) do not hold the dataset up. An append or merge into it is accepted and queued instead (MergeDatasetsResponse.joining_uploads): the recording joins once the time sync has settled. With cancel_merged_sync the time sync is withdrawn, and with it the waiting; recordings already re-processing keep fencing the dataset while an attempt runs or awaits publication, not between a failed attempt and the re-arm of its re-ingest’s own next attempt (up to three, within minutes). They are then told as “N recordings are still re-processing; wait for them to finish before removing recordings, running the solver or creating a version” (a pose move is told as one). An append is queued meanwhile, and the queue waits for that window too, for ten minutes at most after the failed attempt.

account
required
string

The account id.

dataset
required
string

The dataset id.

Media type application/json

Request for Datasets.ReingestDataset.

object
name
required

Accounts/{account}/datasets/{dataset}

string
ingestConfig

Required unless resume_reingest is set. The complete meta/ingest.toml (schema = 1). It replaces the published file: a table the published file declared and this one leaves out is dropped. Declaring [episodes] spans re-cuts the upload (see ReingestDataset). With merged_settings_context, time_sync_patch or validate_only (a merged dataset) this is instead a strict clock/alignment patch: only schema, clock and channels..align are accepted. Omitted clock keeps it; empty [clock] resets clock/grid/source overrides to automatic. In a nonempty clock table, a supplied fixed_hz or row_clock_topic replaces the grid, and source changes only if supplied. Explicit align = “nearest” resets alignment; omitted topics keep theirs. Unknown/unrouted topics and every other key are refused. The server composes onto the exact captured head, retaining episode boundaries, rig, camera settings and per-channel timestamp offsets.

string
mergedSettingsContext

Explicitly confirmed MCAP clock/alignment edit of one merged member. Other config tables and episode boundaries must remain unchanged. Older callers without this context retain the existing member re-cut rules.

object
mergedDataset
required

The merged dataset whose membership was confirmed.

string
members
required

Every upload it held, in merge order, including the selected upload.

Array<string>
membershipRevision
required

Opaque merge/undo epoch from GetDataset; never recapture it on retry.

string
etag
required

The dataset’s editable etag; a member edit sends the selected upload’s.

string
sourceCommit

The selected upload’s exact paired head. Empty on the merged dataset’s context, which is used only to fence global label edits.

string
requestId

UUID retry key, required with merged_settings_context. A replay retains its original operation and membership scope, never today’s membership.

string
resumeReingest

Resume this exact completed corrective publication. No ingest_config, request_id or merged_settings_context may accompany this operation.

string
timeSyncPatch

Treat ingest_config as a patch of the upload’s time sync instead of the whole file, so editing the time sync cannot drop what the upload’s published meta/ingest.toml holds besides it: camera stamp offsets, the rig and its calibration, camera settings, state and action topics and episode boundaries. Only schema, [clock] and [channels.] align are accepted; any other key, or a topic that is not a routed state or action channel of the upload, is INVALID_ARGUMENT. The patch is applied to the file published when the request is read: FAILED_PRECONDITION for a non-MCAP upload, ABORTED when the upload is published again meanwhile (read it and retry). Not allowed with merged_settings_context or resume_reingest. A server that does not know this field replaces the whole file with ingest_config.

boolean
validateOnly

Merged datasets only: ingest_config is the time sync every upload the dataset holds is to be processed to. It is then always the strict time sync patch of time_sync_patch (set or not), composed onto each upload’s own published meta/ingest.toml. The answer is ReingestDatasetResponse.merged_sync. With validate_only nothing is written or started (the pre-check); without it the patch is applied (see ReingestDataset). INVALID_ARGUMENT on an upload or a mixture, and with resume_reingest, request_id or merged_settings_context.

Old servers: one that does not know this field ignores it and re-ingests the upload named, whatever its kind, replacing its whole meta/ingest.toml with ingest_config. A client that may reach an older server checks that it knows the field (for example, that GetDataset of the merged dataset carries sync_preparation) before it sends a pre-check.

boolean
members

Merged only: the uploads (accounts/{account}/datasets/{dataset}) the call is about, each of which the dataset must hold (NOT_FOUND otherwise). Empty means every upload it holds. With validate_only they are the ones checked. Without it they are Try again: the patch must be the dataset’s current time sync (INVALID_ARGUMENT otherwise), and only these uploads are composed again and, if they can take it, set to wait for the driver; the others are left as they are.

Array<string>
membershipRevision

Required for a merged dataset: the membership_revision of GetDataset’s sync_preparation. ABORTED when the dataset’s uploads have changed since: read it again and confirm again.

string
cancelMergedSync

Merged only: Cancel. Withdraw the dataset’s time sync: it is no longer the dataset’s (as when another time sync replaces it), so sync_preparation shows no target, nothing that waits is re-processed, the driver dispatches nothing again for it, and a recording appended later is not re-processed. A recording already re-processing finishes and publishes (a re-ingest cannot be stopped once the worker has it); if it fails in a way that may be retried, the driver does not dispatch it again, but its re-ingest’s own attempts, up to three, still run. While an attempt runs or awaits publication, that recording fences the dataset (an append, a Remove, a version and the solver are FAILED_PRECONDITION); between a failed attempt and the re-arm of the next nothing does. A recording that already holds the time sync keeps it. Applying a time sync again starts a fresh one: the recordings that hold it read CURRENT, and one that still runs joins its running re-ingest. One DATASET_UPDATED (path time_sync) records “Time sync change cancelled for N recordings” (“Time sync change cancelled” when none was to be brought to it). Cancelling again changes and records nothing. Cancel does not look at whether anything waits or runs: on a dataset whose time sync is finished it still withdraws the time sync (appended recordings are then not re-processed, and the folded ingest report compares stamp offsets again). Needs membership_revision. INVALID_ARGUMENT with ingest_config, members, validate_only, time_sync_patch, request_id, resume_reingest or merged_settings_context, and on a dataset that is not merged; FAILED_PRECONDITION on one that never had a time sync. The answer is ReingestDatasetResponse.merged_sync (no target), cancelled_members and running_members. An older server ignores this field and answers the missing ingest_config.

boolean
Example generated
{
"name": "example",
"ingestConfig": "example",
"mergedSettingsContext": {
"mergedDataset": "example",
"members": [
"example"
],
"membershipRevision": "example",
"etag": "example",
"sourceCommit": "example"
},
"requestId": "example",
"resumeReingest": "example",
"timeSyncPatch": true,
"validateOnly": true,
"members": [
"example"
],
"membershipRevision": "example",
"cancelMergedSync": true
}

OK

Media type application/json

Response for Datasets.ReingestDataset.

object
reingest

The re-ingest it admitted (QUEUED), or with unchanged set, the publication that already carries the config (SUCCEEDED). Unset for a merged dataset.

object
name

Accounts/{account}/datasets/{dataset}/reingests/{reingest}

string
state

Where the work stands.

string format: enum
Allowed values: STATE_UNSPECIFIED QUEUED PREPARING PUBLISHING SUCCEEDED FAILED
unchanged

The posted config was the published one: nothing ran, and this names the publication that already carries it.

boolean
failureReason

Why it failed; empty unless FAILED.

string
progress

While PREPARING: the live step, the same open set of fields the upload feed reports (step, detail, counters).

object
episodeCount

Once SUCCEEDED: episodes in the published generation.

string
frameCount

Once SUCCEEDED: frames in the published generation.

string
poseAttempt

Attempt currently preparing a pose move, or zero when cancellation is unavailable.

integer format: int32
publicationFailure

Most recent safe publication failure while publishing, if any.

string
recutResult

Present only when a verified re-cut result committed atomically with this successful publication. Absence is not an empty/clean result.

object
notCarriedCount

Exact number of old original takes with state not carried. Zero means the verified publication lost no state; no such take is listed.

string
publicationCommit

Immutable publication commit, used to bind every page of the result.

string
mergedSync

A merged dataset’s time sync (pre-check, apply or Cancel): one answer per upload checked or applied to, and after a Cancel as GetDataset reads it (no target). Set only then.

object
membershipRevision

Opaque ordered-membership epoch the answer was made at (the same value as MergedPosePreparation.membership_revision). Send it back to pre-check or apply.

string
target

The patch, in canonical form: schema, then [clock] (row_clock_topic, fixed_hz, source), then one [channels.] with its align for each aligned topic in byte order of the topic, as the server applies it. Floats always carry their point. Empty in GetDataset while the dataset has no time sync: none has been applied, or it was withdrawn by a Cancel.

string
currentMembers

Of the uploads counted, how many already hold the patch.

integer format: int32
totalMembers

Number of uploads that can hold a time sync: all the dataset holds, or those named in ReingestDatasetRequest.members, except the ones that are not ROS recordings (NOT_APPLICABLE), which are counted in not_applicable_members. So “current_members of total_members” can reach “N of N” whatever else the dataset holds.

integer format: int32
members

One answer per upload checked or applied to, in membership order. In GetDataset, the uploads that do not hold the patch yet, and none while the dataset has no target. Uploads that are NOT_APPLICABLE are listed here too, though they are not counted in total_members.

Array<object>

One upload’s answer in a merged dataset’s time sync.

object
upload

The upload resource: accounts/{account}/datasets/{dataset}.

string
displayName

The upload’s display name.

string
state

The upload’s state against the patch.

string format: enum
Allowed values: STATE_UNSPECIFIED CURRENT WAITING RUNNING BLOCKED FAILED NOT_APPLICABLE
reason

A plain phrase that follows the display name (“has no /joint_states to clock rows by”); empty when there is nothing to say.

string
skippedTopics

Channels the patch aligns that this upload does not route. They are skipped for this upload, which keeps what it has, and named here.

Array<string>
operationId

UUID polled at this upload’s reingests/{operation_id} resource (GetReingest) once the driver has admitted its re-process; empty before, and in a pre-check.

string
publishing

While RUNNING: the work is done and the new generation is being published.

boolean
waitingOnOperationId

While BLOCKED only because another re-ingest or tool center point move of this upload is still running: that operation’s UUID (the upload’s reingests/{operation_id}). The upload then moves by itself when it ends, so it is not a leftover and needs no Try again, and it holds the dataset’s uploads fixed until it has. Empty for every other upload, including a BLOCKED one that does need action. Clients should read this, not the reason text, to tell the two apart.

string
notApplicableMembers

Of the uploads counted by the answer, how many are not ROS recordings (for example LeRobot uploads) and so have no time sync to change. They are in neither current_members nor total_members; a client can say “3 recordings have no time sync”. An older server counts them in total_members and leaves this 0.

integer format: int32
joining

Uploads appended to the dataset while its uploads re-processed, which have not joined it yet (MergeDatasetsResponse.joining_uploads): “N recordings will join after the current re-processing”. Set by GetDataset, an apply and the answer to a Cancel (read with the members, in the same query); empty in a pre-check. They are not members: they are in none of the counts above.

Array<object>

An upload waiting to join a merged dataset (MergedSyncPreparation.joining).

object
upload

The upload resource: accounts/{account}/datasets/{dataset}.

string
displayName

The upload’s display name.

string
actionNeeded

The upload could not join (it became incompatible with the dataset, or the dataset or the recording is gone) and stays standalone; reason says why. A person appends it again once the reason is gone.

boolean
reason

Why, when action_needed; empty otherwise.

string
cancelledMembers

Cancel only (cancel_merged_sync): how many recordings were to be brought to the time sync and no longer are: waiting, blocked only by another job, claimed to be composed again (or by a replica that died), or failed in a way the driver would have retried and their re-ingest’s own attempts will not. A recording blocked by an earlier time sync’s re-ingest of it that still runs is in this count and in running_members; one blocked by a tool center point move or another re-ingest is in this one only.

integer format: int32
runningMembers

Cancel only: how many recordings still run, across all of the dataset’s time syncs (an operation is one): recordings whose attempt runs or awaits publication, ones whose attempt failed within the last ten minutes in a way that its own waiter may still re-arm (up to three attempts), and recordings the driver had claimed and not yet started when the Cancel landed. Those whose attempt runs finish. Only an attempt that runs or awaits publication fences a Remove, a version or the solver, so this can be above 0 while nothing does (an append is queued then, and the queue waits for them). A repeated Cancel counts them the same way (the number falls as recordings end). A claim the Cancel meets before its re-ingest has started is counted but may not start: the driver puts it back, its admission is refused or not answered, or its replica died.

integer format: int32
Example
{
"reingest": {
"state": "STATE_UNSPECIFIED"
},
"mergedSync": {
"members": [
{
"state": "STATE_UNSPECIFIED"
}
]
}
}

Default error response

Media type application/json
One of:
API error

A refusal from the API itself.

object
code
required

The gRPC code name in upper case, e.g. NOT_FOUND.

string
message
required
string
retryable
required

Whether the same call may succeed if retried.

boolean
details
required

Empty, except when a dataset copy or move is refused: then one google.rpc.ErrorInfo with the refusal’s reason code, its domain and, in metadata, the datasets it names.

Array<object>
object
Example generated
{
"code": "example",
"message": "example",
"retryable": true,
"details": [
{}
]
}