Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • org.apache.accumulo.core.master.state.tables.TableState

2.2

...

Changes to FATE Operations

Certain behavior of normal FATE operations should be modified to accommodate trash can feature.

...

  • Change the table state to TRASH
  • Change the table name to something unique that preserves the original table name such as "trash-<origname><yyyymmddhhmmss><count>"
  • Add table to the timer maintain in master so that after a configurable timeout, the tables in trash are automatically deleted.

Whereas, if the delete table operation is called on a table already in the TRASH state, it should proceed with the normal delete operations.

2.2.2 Undelete Operation

Undeleting a table This will require a new fate operation. This fate operation should be very similar to the rename table operation, with the additional operation of changing the table state to ONLINE. The original name of the table in the trash can be extracted from its table-name. The table should be renamed to this name.

2.2 Changes in Behaviors

When the master sees a table state of TRASH, the goal state for tablets in that table should be UNASSIGNED. Attempting to initiate an operation on a table in trash should fail. Checks like this are already conducted for offline tables. We can do checks for trash tables in the same place.

The amount of time tables spend in the trash state before really being deleted should be configurable via a system property. Network timing can be unreliable. So, the master can be modified to maintain a timer which keeps track of when each table in the trash should be deleted. Tables can be added to this timer by the delete operation. And on timeout, the timer can simply trigger a delete FATE operation of the corresponding table in the trash.