Skip to content

Commit

Permalink
Use system tables for sharding
Browse files Browse the repository at this point in the history
  • Loading branch information
donhardman committed Jan 8, 2025
1 parent bdb4cf8 commit a273c25
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Plugin/Sharding/CreateHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ protected static function getShardingFn(): Closure {
$timeout = $payload->getShardingTimeout();
while (true) {
// TODO: think about the way to refactor it and remove duplication
$q = "select value[0] as value from _sharding_state where `key` = 'table:{$payload->table}'";
$q = "select value[0] as value from system.sharding_state where `key` = 'table:{$payload->table}'";
$resp = $client->sendRequest($q);
$result = $resp->getResult();
/** @var array{0:array{data?:array{0:array{value:string}}}} $result */
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/Sharding/DropHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected function validate(): ?Task {
*/
protected function getTableState(string $table): array {
// TODO: think about the way to refactor it and remove duplication
$q = "select value[0] as value from _sharding_state where `key` = 'table:{$table}'";
$q = "select value[0] as value from system.sharding_state where `key` = 'table:{$table}'";
$resp = $this->manticoreClient->sendRequest($q);

/** @var array{0:array{data?:array{0:array{value:string}}}} $result */
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/Sharding/Queue.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __construct(
protected Cluster $cluster,
protected Client $client
) {
$this->table = '_sharding_queue';
$this->table = 'system.sharding_queue';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/Sharding/State.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class State {
public function __construct(
protected Client $client
) {
$this->table = '_sharding_state';
$this->table = 'system.sharding_state';
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Plugin/Sharding/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(
protected readonly string $structure,
protected readonly string $extra
) {
$this->table = '_sharding_table';
$this->table = 'system.sharding_table';
}

/**
Expand Down

0 comments on commit a273c25

Please sign in to comment.