Documentation — Commands reference

repair

Brings the out-of-date segments of a table back in line with the sane ones.

Syntax

repair [table] TABLE_NAME [using DIRECTORY];

How it works

For each out-of-date segment, SynSQL exports the content of a sane segment of the same partition into a file, and imports it into the out-of-date segment. The file goes to /tmp unless you give another directory with using: take a directory with enough space for the biggest segment.

Rules

  • You need the UPDATE privilege.
  • Lock the table first (lock table T;): no write must happen during the repair.
  • The table must have two or three copies. A table with one copy cannot be rebuilt: if you recovered the data broker with its data, use alter table T set segments up;.
  • All the data brokers that hold the segments must be available. If one is not, the command may report a repair that did not happen: the next write on that segment fails and marks it out of date again.

Wide tables

The repair works on every chunk of the table.

← lock  |  revoke →