Skip to main content

Recovery

Synopsis​

A Director repairs problems with its built-in queue by itself. For example, it starts the queue again when the queue stops working, replaces a damaged copy of a stream with a new copy from the other Directors of its cluster, and frees space when its disk is full. You don't need to do anything for these repairs.

A repair never deletes the data that it replaces. The Director keeps that data aside on its disk, so that support can read it later. Some repairs lose data, such as records that no other Director held. The Director then says what was lost.

The Recovery card on the Director's Health tab shows every repair, and what is stuck on the Director right now. When no repair works without losing data, the Director's recovery setting decides what it does. It either saves a copy of its data and starts clean, or it stops and waits for a person.

Directors report their repairs from version 2.8.0. A Director of an earlier version reports none, and the card says that its version doesn't report repairs.

The built-in queue keeps its records in streams. A reader takes the records of a stream and hands them on for delivery. The console uses both words.

The Recovery Card​

The Recovery card is on the Director's Health tab. It lists the repairs that the Director made by itself in the last 30 days, the newest first. The time range of the tab doesn't change this list. A Director that needed no repair shows "This director has needed no repair."

ColumnShows
WhenWhen the Director made the repair
What was repairedThe Director, the cluster, a stream or a reader
What happenedThe problem that the Director found
What the director didThe repair
What was lostNothing, how many records were lost, or the Director's own description of the loss
Where the old data is keptThe folder where the Director keeps the data that the repair replaced
Repair IDA short ID of eight letters and digits. Give it to support when you ask about the repair

The Director's own words, such as the description of a loss, are in English.

Warnings. Above the list, the card shows a warning for each problem that is stuck on the Director right now. Each warning says since when, what the Director does meanwhile and what you can do. When the Director gives more detail, the warning ends with "The director reports:" and the Director's own words. See Warnings for each one.

Tag. While the Director waits for support, the card's header shows Waiting for support. After someone uses Recover now, it shows Recovering until the Director has made the repairs that it held back.

Permissions. You need permission to read Directors to see the card, and permission to edit Directors to use its buttons. Without permission to edit, you still see the warnings, and they say that someone who can edit Directors can act.

Actions​

The card offers an action only when the Director says that it applies. Each action asks you to confirm first. For a Director with several machines, the card names the machine that runs the action.

  • Recover now - Shown while the Director waits for support. It ends the wait. The Director takes new logs again and makes the repairs that it held back. Those repairs can lose data, and the card lists what each one lost. See Waiting for Support.
  • Start the queue empty - Shown when this Director's copies of some streams take no part in those streams. The Director moves its whole store aside as a quarantine copy, starts the queue empty and copies every stream again from the other Directors of its cluster. It reloads to do this, so it takes no logs for a few seconds. Records that only this Director's copy held aren't delivered, but you can add them back from the copy later. A Director whose built-in queue keeps its streams in shared state storage doesn't offer this action, because the streams would come back from that storage. The card says so.
  • Add records back - Shown for each quarantine copy whose records can go back to the queue. See Adding Saved Records Back.
  • Keep longer, Keep until deleted, Keep for the usual time and Delete copy - Shown under each quarantine copy. See Keeping or Deleting a Copy.

A Director of a later version can offer an action that the console doesn't know. The card then shows the Director's own title and description, with Run action.

When something is stuck and no action applies, a line under the warnings says why. No action applies now, the Director didn't answer, it isn't connected, or its version can't run recovery actions.

The Notice Above the Tabs​

For a day after the Director repairs something by itself, a notice above the tabs of the Director's page says what happened, what the Director did and what was lost. When the repair set data aside or lost data, the notice also says where the old data is kept and gives the repair ID. The notice is a warning when the repair lost data, and information otherwise. It shows the newest repair only.

Repairs that a person asked for, such as Recover now or Add records back, show no notice.

The Cluster's Notices​

The page of a cluster shows two notices about the recovery of its Directors:

  • This cluster formed again - For a day after the cluster took the last resort. It says what each Director lost, where each one set its copy aside, and the ID of each Director's repair.
  • Directors of this cluster wait for support - Which Directors wait, why, and what you can do. It reads A director of this cluster waits for support when only one waits.

You need permission to read clusters to see them.

Alert Rules​

Four system rules alert on a Director's recovery: Director repaired itself, Director formed its cluster again, Director waits for support and A director's copy waits to start over. See System rules under Rules.

Warnings​

The card shows each warning in plain words. The code in the first column is what the Director reports to the platform. The codes don't change between releases, while the words can.

CodeWarning on the cardWhat to do
queue_cannot_startThe built-in queue doesn't startFix the cause that the Director reports. If you can't, contact support
disk_fullThe director's disk is fullFree disk space, or give the Director a larger disk. See A Full Disk
disk_room_last_copyThe director will delete a folder that a repair kept asideTo keep the folder, free disk space before the time that the Director gives
disk_room_nothing_leftThe director's disk is full, and nothing is left to deleteFree disk space, or give the Director a larger disk
waiting_for_supportThis director is waiting for supportFix the problem, or use Recover now. See Waiting for Support
cluster_formed_without_this_directorThe cluster formed again without this directorNothing. The warning ends when the Director has added its saved records back. If it couldn't finish, use Add records back
no_meta_leaderThe cluster has no leaderCheck that most of the cluster's Directors run and can reach each other
meta_may_be_splitThis director may be cut off from its clusterIf it lasts, check that this Director can reach the other Directors of its cluster. See Meta Group May Be Split in Troubleshooting
no_leaderNo director leads the stream or readerIf it lasts, check that the cluster's Directors can reach each other
not_in_clusterThis director is no longer a member of its clusterIf the Director belongs in the cluster, add it to the cluster's members again
stream_heldThe stream is held backContact support. The stream takes no records until someone decides how it goes on. See A Stream Is Held Back in Troubleshooting
copy_kept_outThis director's copy of the stream is kept outIf it lasts, contact support. The stream runs with one copy fewer meanwhile
copy_cannot_set_asideThis director's copy of the stream can't start overIf it lasts, check the Director's disk and data folder, or contact support
copy_waits_to_start_overThis director's copy is waiting to start overIf a Director of the cluster is gone for good, remove it from the cluster's members. The copy then starts over by itself. Otherwise, check that the cluster's Directors run and can reach each other
meta_state_differsThe directors hold different information about the streamIf it lasts, contact support. See A Director Whose Record of the Cluster Differs
consumer_state_unreadableThe reader has lost its positionRestart the Director once with -recover=accept-loss. The reader then starts again, and can skip the records that it hadn't delivered. See Starting a Director Once with -recover
store_cluster_waitsA machine of the store cluster is waitingIf it lasts, fix what the machine waits for. The Director's report names it
trusted_key_unreadableThe trusted key couldn't be readReset the key. For an agent, open the agent's page and use Reset agent key in the Actions menu

A warning that the console doesn't know shows the Director's own message. When the platform received only part of the Director's last report, a line under the warnings says that the list may be incomplete.

The Recovery Setting​

The Director always tries to repair a problem first. The recovery setting decides what it does when no repair works without losing data.

ChoiceWhat the Director does
Save a copy of the data and start cleanThe default. The Director keeps a copy of the data that it can't repair, and goes on without that data. New logs keep flowing
Stop and wait for supportThe Director makes no repair that loses data. It takes no new logs until a person acts

Where you set it:

  • For a Director, the heading is If the director cannot repair itself. It is the last block of the General settings step of the creation wizard, for every mode. After creation, it is a row of the General settings card on the Director overview tab. See Deployment and Management.
  • For a cluster, the heading is If a director cannot repair itself. It is the last setting of the General settings step of the cluster wizard. After creation, it is on the cluster's Configuration tab. See Clusters.

A cluster's choice applies to every Director in the cluster, and it wins over a Director's own choice. A cluster can also make no choice. It then shows "Not set. Each director uses its own choice.", and each Director uses its own. A Director without a choice saves a copy and starts clean. On a Director in a cluster, the row is read-only, and a note under it says whether the cluster's choice or the Director's own applies. You change it on the cluster's Configuration tab.

A change takes effect without a restart.

The choice matters in four cases:

  1. A damaged part of the store that no other Director holds. This is a stream on a Director without a cluster, or a stream with one copy. The Director tries to read the part three times. With Save a copy of the data and start clean, it then moves the part aside and starts it empty. With Stop and wait for support, it leaves the part as it is and waits. A copy that other Directors hold is always copied again from them, because that loses nothing.
  2. A Director that comes back after its cluster formed again without it. With Save a copy of the data and start clean, the Director saves its whole store as a quarantine copy, joins the cluster again and adds the saved records back by itself. With Stop and wait for support, it leaves its store as it is and waits.
  3. Data that can no longer be trusted, when no repair works. For example, no Director can read its copy of the cluster's record of its streams, or the store of a Director without a cluster can't be read. With Save a copy of the data and start clean, the Directors take the last resort. With Stop and wait for support, they wait.
  4. A machine of a store cluster that holds none of the cluster's data, while every machine that holds the data stays away. With Save a copy of the data and start clean, the machine waits for recovery.last_resort_after, 10 minutes by default, and then starts a new cluster without them. With Stop and wait for support, it waits for a person. A machine with the data that comes back later hands the new cluster the records that it lacks. On an Orchestrated Director, the Cluster card of the Health tab shows the wait, and a person can start a new cluster there. See Health Tab in Management.

The setting is the key recovery.mode. It has three more keys, which only vmetric.yml, a deployment template or the API set: how long to wait before the last resort, and where and how long to keep quarantine copies. See Recovery in Service Configuration.

Waiting for Support​

While a Director waits for support:

  • It takes no new logs. An HTTP sender gets the answer 503 with a Retry-After header, and sends again later. An agent keeps its records and sends them later. A source that saves its position doesn't move it. TCP sources aren't read, so their senders wait.
  • UDP devices can lose what they send. The operating system keeps only what fits in each source's receive buffer, and the Director reads that when the wait ends.
  • The built-in queue still delivers the records that it holds, and drops records older than their Retention period as usual.
  • The Director makes no repair that changes its disk. It frees no space, deletes no folder kept aside, and adds no quarantine copy back by itself. A copy of a stream that other Directors hold still starts over from them, because that loses nothing.
  • A device whose records go straight to their target, without the queue, isn't held.
  • The Recovery card shows Waiting for support and the warning "This director is waiting for support", with why. The Director's health status is waiting_for_support, it reports itself as not ready, and the alert Director waits for support opens.

The wait survives a restart. The file support-wait.json in the Director's data folder says what the Director waits for.

The wait ends in one of three ways:

  • The cause is fixed.
  • Someone uses Recover now on the Recovery card.
  • The recovery setting changes to Save a copy of the data and start clean.

After Recover now or the change of setting, the Director makes the repair that it held back and takes new logs again. The card shows Recovering until the repair is done.

A Director can also wait for support with the default setting. The warning says why. For example, the cluster took the last resort less than 24 hours ago, a Director of the cluster runs release 2.7.0, which can't take it, or some Directors don't answer while the cluster forms again.

The Last Resort​

When the data of a cluster can no longer be trusted and no repair works, the Directors save everything and start clean. A Director without a cluster does the same when its store can't be read. The Directors take this last resort only when all of these are true:

  • Every Director of the cluster sees the same problem for recovery.last_resort_after, 10 minutes by default, without a break.
  • Every Director that the cluster lists answers. They all run the same release with the same cluster settings.
  • No Director is down, the witness and the store copy answer, no disk is full, no setting is wrong and no update runs.
  • The cluster hasn't taken the last resort in the last 24 hours.
  • No Director runs release 2.7.0.

When the cluster took the last resort less than 24 hours ago, or the setting is Stop and wait for support, the Directors wait for support instead. Recover now then takes the last resort. With a Director on release 2.7.0, Recover now can't take it.

When the Directors take the last resort, each one does this:

  1. It stops taking new logs.
  2. It reads the positions that its sources saved, and the agent keys that it trusts.
  3. It moves its whole store into a quarantine copy, and starts its queue empty.
  4. It writes the saved positions and keys back, and takes new logs again. Each source goes on from where it stopped.
  5. It records the repair. The alert Director formed its cluster again opens, and the cluster's page shows This cluster formed again.

The records that waited in the queue are in the quarantine copy. They aren't delivered until a person adds them back with Add records back. Two kinds of value can be lost:

  • A saved position that no copy can read. That source starts as it does when it has no position.
  • An agent key that no copy can read. The Director then refuses that agent or host until someone resets its key in the console. The warning "The trusted key couldn't be read" names the key.

Don't roll a cluster back to release 2.7.0 after it formed again. Release 2.7.0 can't read its data.

Sometimes every copy of one stream is damaged while the rest of the cluster works. Then only that stream forms again, under the same rules. Its Directors save their copies of the stream in one quarantine copy, and the stream is made again with its settings and readers. A cluster with a store copy doesn't make the stream again by itself, because the store copy may hold a good copy of it. Its Directors report the problem and wait for a person.

What a Director Keeps Aside​

Quarantine Copies​

A quarantine copy holds the Director's whole built-in queue store as it was. The Director makes one in these cases:

  • Someone starts the Director with -recover=reset, or uses Start the queue empty on the Recovery card.
  • The Director takes the last resort.
  • The Director comes back after its cluster formed again without it.

Each copy has its own folder in the Director's data folder, <vm_root>/Director/storage/data: quarantine/<cluster or director>/<UTC time>-<repair ID>/. It holds a folder for each server with that server's store, and a manifest.json file that lists every file with its size and SHA-256. A copy without a manifest wasn't finished.

With recovery.quarantine.url, the Director copies each copy to a folder, a network share, Azure Blob Storage or Amazon S3 instead. It copies in the background, at 32 MiB per second at most, so that the copy doesn't slow the records that keep flowing. It reads every file back and checks it, and writes the manifest last. Only then does it delete its local folder. A copy that a stop cut off goes on at the next start.

A quarantine copy doesn't hold the Director's vmetric.yml, because that file can hold passwords and keys. The manifest holds the file's SHA-256 instead, so support can tell which configuration the Director ran with. An encrypted store is copied as it is, without its key.

Folders Kept Aside in the Store​

Smaller repairs keep what they replace inside the built-in queue's folder, <vm_root>/Director/storage/nats, in folders named set-aside. Such a folder holds a stream's records, a reader's position, or the log of a group of copies. Each one has a manifest.json that says what it holds, why it went aside and when. The Where the old data is kept column of the Recovery card names the folder.

When the records of such a folder can be read again, the Director hands them back to their stream by itself. It looks every minute.

A Director that is started with -recover=reset and can't move its store into its data folder, for example because the two are on different disks, moves the store beside itself instead, as <store>.reset-<time>.

When They Are Deleted​

  • A quarantine copy is kept for recovery.quarantine.keep, 30 days by default. This also applies to copies in recovery.quarantine.url.
  • The other folders kept aside are kept for 30 days. No setting changes this.

The Director looks at its disk once an hour, and at recovery.quarantine.url every 6 hours. It deletes what is past its time, with four exceptions:

  • A copy that the Director hasn't finished copying to recovery.quarantine.url stays until the copy there is checked.
  • The copy that a Director made when it came back after its cluster formed again without it stays until its records are added back. Its records are nowhere else.
  • A person can keep a copy longer, or until they delete it. See Keeping or Deleting a Copy.
  • A full disk can delete a folder sooner, after a warning. See A Full Disk.

To keep a folder, for example for a support case, copy it to another place before it is deleted.

Keeping or Deleting a Copy​

Under the notice of each quarantine copy on the Recovery card, a user who can edit Directors has these buttons:

  • Keep longer - Choose the last day on which the Director keeps the copy. The day must be after the day on which the Director would delete it by itself. Once someone has chosen a day, the button reads Keep until a day.
  • Keep until deleted - The Director keeps the copy until a person deletes it.
  • Keep for the usual time - Shown once someone has chosen. The copy goes back to recovery.quarantine.keep.
  • Delete copy - Deletes the copy now. This can't be undone. When the copy holds records that no other copy holds, tick "I understand that these records are lost for good." before the button works.

The Director writes the choice into the copy. So the choice holds after a restart, and every Director that shares recovery.quarantine.url follows it. The notice says where the copy is, how large it is, until when the Director keeps it, and who chose.

The buttons aren't shown while the records of the copy are being added back, or while the Director deletes the copy. Delete copy isn't shown while the Director waits for support. A full disk can still delete a copy that someone chose to keep, after the usual warning, unless the copy holds records that no other copy holds.

Adding Saved Records Back​

Each quarantine copy whose records can go back to the queue has a notice on the Recovery card. Its title reads "Records saved from the built-in queue on", followed by the date. The notice says about how many records the copy holds, in how many streams, and which streams take none of them.

Add records back adds the records to the queue again. Its confirmation says that records that were delivered but not yet marked as handled can arrive a second time, and that adding the records back can't be undone. While the Director adds them, the card shows how many it has added so far. At the end, a table shows what each stream took, with Stream, Records added and Details.

  • Records that every reader of a delivery stream had already handled are left out.
  • A stream that keeps one record for each key keeps the newer record that it already holds.
  • A stream that the queue doesn't have any more is created again, with its readers.
  • Some streams take no records from before their cluster formed. They get none.
  • A copy is added back once. A second run adds nothing, and the notice says when the first one ran.
  • A run that stops before it ends can run again. It goes on with the streams that are left.

A Director that comes back after its cluster formed again without it adds its copy back by itself. Until it has, the card shows "The cluster formed again without this director". If it can't finish, use Add records back to add the rest. Every other copy, such as one from -recover=reset, waits for a person.

A Full Disk​

When the disk that holds the built-in queue is full, the queue stops. The Director then frees space by itself, and the queue starts again once the disk has room. While the queue is stopped, the Director checks every 30 seconds and deletes, in this order:

  1. The folders that repairs kept aside and that are past their keep time.
  2. The content of its log file, <vm_root>/Director/storage/logs/debug.log, when the file holds 1 MiB or more.
  3. Buffer files older than the Retention period (persistent_storage.max_age). The Data loss card on the Health tab counts them.
  4. The reserve file, but only when the queue still has no room to start.
  5. The oldest folder kept aside, although it is younger than its keep time, but only when the queue still has no room. Quarantine copies go first, the oldest first. A copy that a person chose to keep goes last.

The Director never deletes, in step 5, a copy that holds records that no other copy holds, or the copy of a cluster that formed again without the Director before its records are added back.

Before step 5, the Director warns for 5 minutes. The warning "The director will delete a folder that a repair kept aside" names the folder and the time at which the Director deletes it. To keep the folder, free disk space before that time. The Director then deletes that one folder. The next folder gets a warning of its own.

When nothing is left that the Director may delete, the queue stays stopped. The warning "The director's disk is full, and nothing is left to delete" says so. Free disk space, or give the Director a larger disk.

After the queue has started again, the Director drops its oldest stored records, but only as many as it needs to keep running. The disk needs 112 MiB free, and the size of the reserve file as a margin. The Director's Total size limit stays the same. The repair says how many records the Director dropped, and how long the oldest had waited.

Some more rules:

  • The 30 days of the folders kept aside and the 5-minute warning are fixed. recovery.quarantine.keep changes the keep time of quarantine copies only.
  • On a system where the Director can't read the disk's free space, it runs steps 1 to 3 only, and raises neither warning.
  • While a Director waits for support, it frees no space.

The Reserve File​

The Director keeps a file named queue-disk.reserve beside its built-in queue's folder, in <vm_root>/Director/storage. The file holds no data. It only takes space, so that the Director can give that space back when the disk is full.

Disk sizeSize of the reserve file
6.25 GiB or more128 MiB
About 5.5 GiB to 6.25 GiB2% of the disk
Below about 5.5 GiB112 MiB
  • Count this space when you size a small disk. The stored data can't use it.
  • Don't delete the file by hand to gain space. The Director makes it again.
  • The Director makes the file about a minute after it starts, and again after it gave the space back. It waits until the disk has at least twice the size of the file free, and 4 MiB more.
  • When the Director has the space and still can't write the file, it logs a warning and runs without it.
  • A Director that stopped while it wrote the file leaves a part of it behind, as queue-disk.reserve.tmp. The Director deletes that part itself.

A Director Whose Record of the Cluster Differs​

Each Director of a cluster keeps the cluster's record of where every stream and reader has its copies, and with what settings. The records should be the same on every Director. When a Director's record differs, the Directors find the difference and repair it by themselves. The Director keeps running, and only the streams that differ change.

  • Every 30 seconds, the Director that leads the cluster sends the others a summary of its record. A Director compares it only when it has read the cluster's log as far as the leader. So a Director that is only behind never counts as different.
  • When most Directors hold one version of a stream's record, each Director that differs takes that version.
  • When most Directors hold another version than the leader, the leader first hands its lead to a Director that holds that version. The old leader is then repaired in the same way.
  • When no version is held by most Directors, the leader rebuilds the stream's record from the cluster's log, if the log holds the stream's whole history.

Each repair is listed on the Recovery card, and in the recovery journal with the code meta_state_caught_up. It says what the Director held, what it took, and whether it took it from the leader or from the cluster's log.

A repair can remove a stream that most Directors don't hold. The Director then keeps its copy in a folder aside, with the stream's records and its readers' positions. The folder records when the stream was made. The Director hands the records back only to that same stream, never to a new stream with the same name. A stream kept in memory, and a reader with one copy, have nothing to keep aside. The repair then says what was lost: the stream's records, or the reader's position.

When a difference isn't repaired yet, the card shows the warning "The directors hold different information about the stream" (meta_state_differs). The Directors keep checking. The warning's reason says why:

ReasonMeaning
repairs_did_not_endThree repairs didn't end the difference on this Director. It keeps trying, and waits 1, 2, 4 and up to 32 checks between tries
no_majorityNo version is held by most Directors, and the cluster's log doesn't hold the stream's whole history. The next change of the stream settles it
leader_outvotedThe leader holds another version than most Directors, and couldn't hand its lead over yet

The check also sends a stats row, meta_check. See Device Resource Fields in DataStream Stats.

The Recovery Journal​

Each Director keeps a record of what it repaired by itself, in the file recovery-journal.jsonl in its data folder, <vm_root>/Director/storage/data. Each line is one repair, in JSON. It says when the repair happened, a code for the kind of repair, and what the Director did. It names the stream or the reader when the repair was about one, and says what was lost when something was. The file keeps the last 200 repairs, and a restart doesn't clear it. The Director sends each repair to the platform, and the Recovery card shows the last 30 days.

The messages are written for people, and their words can change. The codes stay the same, so match alerts and scripts on the codes.

CodeWhat the Director did
queue_restartedThe built-in queue stopped working, and the Director started it again
stale_takeoverNo Director with an up-to-date copy of a stream was left to lead it. This Director took the stream over with the records that it held
store_takeoverThe Director that ran the shared built-in queue stopped, or the queue had to start again. This Director started the queue from its copy in storage
stream_started_shortNo Director was left to send this Director the rest of a stream. It started the stream with the records that it held, because someone started it with -recover=accept-loss
snapshot_droppedThe Director couldn't read some state that it had saved for its queue. It started without that state, because someone started it with -recover=accept-loss
consumer_resetThe Director couldn't read where a reader had stopped. The reader started again
unwritten_at_stopThe queue stopped while its storage accepted no writes. The Director went on without the records that it couldn't write
range_lost_everywhereNo Director held some records of a stream any more. The stream accepted the loss, so that its readers go on past the missing records
disk_room_freedThe Director deleted files to free space on its disk, or deleted folders kept aside that were past their keep time
stored_records_dropped_for_roomThe disk was full. The Director dropped its oldest stored records to get the space that it needs to run
group_started_againThis Director's copy no longer matched the copy that most other Directors hold. The Director moved its copy aside and copied it again from them
copy_started_againThis Director's copy stopped working. The Director started it again with the data that it held
copy_started_overThis Director's copy didn't work, or didn't match the leader's copy. The Director set it aside and copied it again from the other Directors. Records that only the old copy held may go to the stream again, so some can arrive twice
meta_state_caught_upThe Director held a different record of a stream or reader than the cluster. It took the cluster's record without a restart
store_copy_set_asideThe Director rebuilt its queue from storage and couldn't read the stored copy of a stream. It holds that stream back until the copy can be read
cluster_formed_againThe cluster, a stream, or a Director without a cluster formed again with an empty queue and saved a quarantine copy. Or the cluster formed again without this Director while it was away

When a person asks for something on the Recovery card, the journal records it too, with codes such as recover_now, queue_reset, add_back_started, records_added_back, add_back_failed, copy_keep_changed and copy_deleted. copy_keep_overridden means that a full disk deleted a copy that someone had chosen to keep.

Some repairs lose data, and the Data loss card on the Health tab counts them too. The built-in alert rule Director lost records fires on those losses.

Starting a Director Once with -recover​

-recover is a startup option for a Director whose built-in queue can't start, for example after a total crash or damaged data, or when the Recovery card or support tells you to use it. It applies to one start only. The Director never repeats it when it restarts itself, for example after an update.

  • -recover=accept-loss - The Director goes on with what it holds. In a cluster with a witness, it may lead every stream that it holds at once, whether its copy is up to date or not. It drops local data that it can't read, instead of refusing to start. A stream whose records it doesn't hold starts with the records that it has, or empty. A reader whose position can't be read starts again. Depending on the kind of stream, it starts at the stream's oldest record and can deliver records again, or at its newest record and skips the records that it hadn't delivered. Whatever this Director doesn't hold is lost. A warning in its log names everything that it drops, the Data loss card counts each loss, and the alert Director lost records opens.
  • -recover=reset - The Director starts its built-in queue empty. It deletes nothing. It moves the old store into a quarantine copy and logs where. In a cluster, it then copies every stream again from the other Directors. Records that only this Director held aren't delivered, but you can add them back from the copy. A queue that keeps its streams in shared state storage gets them back from there.

On a host:

  1. Stop the Director's service: Stop-Service vmetric-director on Windows, or systemctl stop vmetric-director on Linux.
  2. In <vm_root>/Director, run the Director once from a command line with the option: .\vmetric-director.exe -recover=accept-loss on Windows, or ./vmetric-director -recover=accept-loss on Linux.
  3. Once the Director takes records again, stop it, and start the service again.

In a container: a container has no service to stop, and the option has no environment variable, so it goes in the container's arguments. The container must start with the Director's data folder, on a volume that outlives the container. Add the option, and take it out again as soon as the Director takes records. A container that restarts with the option in its arguments would use it again.

  • On Azure Container Apps, make a new revision with -recover=accept-loss added to the arguments, and then a revision without it.
  • On Kubernetes, change the args of the pod that should lead. With a StatefulSet, set updateStrategy.type to OnDelete first, and delete only that pod, so that no other pod restarts with the option. Take the change out again in the same way.