This document serves multiple purposes:
|
Accumulo's tables are partitioned into smaller, more manageable pieces called tablets. Partitioning a table into multiple parts allows Accumulo to interact with the table in a parallel fashion making some operations faster. Prior to version 2.1.0 to interact with a tablet it had to be hosted by a Tablet Server. Because the Accumulo server-side components do not know which tablets a client will interact with, it tries to keep all tablets hosted for all online tables. This can be costly for users that don't own their own hardware as they will need to have enough tablet servers running to keep all of the tablets hosted all the time. To make Accumulo more cost efficient we need to remove this constraint (having tablets hosted all the time). Doing so will have some trade-offs with respect to consistency and latency. This document will provide an overview of the goals, design, and major changes being made to Accumulo in support of this goal.
Our goal is to provide a more cost efficient Accumulo that:
The high-level design is to modify Accumulo to allow for tablets in an online table to be unhosted, but still usable for operations that don't require immediate consistency. This requires
In earlier versions Accumulo prioritized data consistency with immediate consistency being the only option. To achieve this consistency, Accumulo:
In version 2.1.0 we introduced eventually consistent reads using the ScanServer component (see https://accumulo.apache.org/docs/2.x/getting-started/design#scan-server-experimental for more information). |
Below is a summary of the major changes in the elasticity branch, which is currently targeting a version 4.0.0 release.
Tablets now have an availability attribute that must be one of the following.
The default value for a tablet's availability is ONDEMAND and this value is assigned to all user table tablets on an upgrade to version 4.0.0. The root and metadata tables have an availability of HOSTED which cannot be changed by the user. Users can use the setavailability and getavailability shell commands or new client API methods to change or view a tablet's availability.
Operations that require immediate consistency use a BatchWriter for inserting Mutations into tables (aka Live Ingest) or use Scanner or BatchScanner with a consistency level of IMMEDIATE (aka Immediate Scans). |
The TabletServer uses a pluggable OnDemandTabletUnloader to determine which on-demand tablets to unload and when. A default implementation exists which will unload a tablet when it has been inactive for a configurable amount of time. The table to the right describes which operations are allowed based on table state and tablet availability.
Because tablets are now hosted on-demand, the tablet management functions have been dispersed to other components. A majority of the functions will now be performed by the Manager. The CompactionCoordinator server component that was introduced in version 2.1.0 has been merged into the Manager. Compactor processes will now perform all Major Compactions for all tables regardless of hosting state (see https://accumulo.apache.org/blog/2021/07/08/external-compactions.html for more information on CompactionCoordinator and Compactor).
Allowed Tablet Operation by Table State and Tablet Availability
| Table State | ENABLED | DISABLED | ||
|---|---|---|---|---|
| Tablet Availability | HOSTED | ONDEMAND | UNHOSTED | |
| Live Ingest | ||||
| Bulk Import v2 | ||||
| Immediate Scans | ||||
| Eventual Scans | ||||
| Map Reduce direct read of files | ||||
| Split | ||||
| Merge | ||||
| Compact | ||||
| Clone | ||||
| Export | ||||
| Summaries | ||||
| Flush | ||||
| Balance | ||||
| Set/Get Table Properties | ||||
1 This action will not cause the tablet to be hosted
2 This action will only occur on currently hosted tablets
The OnDemand Tablets feature requires that tablet management functions move out of the TabletServer. These functions have moved into the Manager and have been integrated into the process that the Manager uses to determine if tablets needs to be assigned or balanced. This process now checks to see if tablets need to be split, merged or compacted based on the tables configuration. User initiated tablet management functions are still FaTE operations but they run within the Manager instead of being delegated to the TabletServer hosting the tablet. Because a single Manager is now doing more work we may need to support multiple active Managers (instead of an active and backup Manager). This work is currently in https://github.com/apache/accumulo/pull/3262.
Having the ability to dedicate resources to tables for various operations like compaction, eventual scan, and immediate scans offers users the ability to dynamically react to changing needs. Accumulo implements this through a combination of being able to start server processes with a resource group option and user configurable plugins that maps tablet execution needs to resource groups. The Compactor, Scan Server, and Tablet Server each support a group property, compactor.group, sserver.group, and tserver.group, respectively. These properties can be passed to the process as an argument when started (e.g. -o tserver.group=App1). These group properties on the server side are used in the following manner:
These properties will allow the user to create a group of Compactors and Scan Servers and/or Tablet Servers to support the needs of one or more tables. Using the metrics emitted by Accumulo, the user should then be able to scale up or down the servers in each group to support the applications needs. Below is an example of what could be done with this capability.
As the root and metadata tables have an availability of HOSTED 1 Manager, Tablet Server, and Compactor server processes need to be running. This is the new minimum required footprint for a functioning Accumulo database. Given the distribution of functions (table to the right) and the tablet availabilities, different deployment strategies can be used depending on the users application requirements. For example, if you have an application that does not need immediate consistency, then its tables can use the UNHOSTED availability and the application can insert data using Bulk Import and read data using Scan Servers. On the other hand, if you have an application that requires low latency and immediate consistency, then its tables can use the HOSTED availability and the application can insert data using the BatchWriter and read data from the Tablet Servers.
Tablet Function Distribution
| Tablet Operation | Supporting Server Components |
|---|---|
| Live Ingest | Tablet Server |
| Bulk Import v1 | Tablet Server |
| Bulk Import v2 | Manager |
| Immediate Scans | Tablet Server |
| Eventual Scans | Scan Server |
| Split | Manager |
| Merge | Manager |
| Compact | Manager+Compactor |
| Clone | Manager |
| Export | Manager |
| Summaries | Tablet Server |
| Flush | Tablet Server |
Prior to the elasticity changes, Accumlo's metadata consistency model was that only a hosted tablet could edit a tablets metadata. One important thing in the tablet metadata is the tablets list of files. For example when a bulk import operation wanted to add files to a tablet, it would find the hosted tablet and request it update the tablet metadata to add the files. This old model is not workable for the goals of elasticity because it requires tablets to be hosted to make any changes to tablet metadata. A new model of was adopted in elasticity of using conditional mutations to edit a tablets metadata. This model allows any server process in the cluster to safely edit a tablets metadata. For the case when a tablets metadata was edited and the tablet is hosted, a new reliable refresh mechanism was also added. This mechanism ensures that hosted tablets read any metadata updates. For example when a compaction finishes it will use a conditional mutation to update the tablets set of files. If the tablet is hosted it will also queue a refresh request that will work even in the case of faults. The refresh request ensures scans on the tablet see the tablets new set of files.
These new refresh request are guaranteed to be processed before any user API operations returns. For example if a bulk import or compaction is initiated using Accumulo's public API, after the API operation returns an immediate scan is guaranteed to see the effect of those operations. This refresh model preserves the consistency behavior that Accumulo had for these operations prior to the elasticity changes. Below is an example of this for compactions.
Below is an example of this for bulk import.