mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-01-05 21:02:58 +00:00
feat: set readonly first when deregister region (#2391)
* feat: set readonly first when deregister region * revert distxxx
This commit is contained in:
@@ -130,7 +130,7 @@ impl RegionServerHandler for RegionServer {
|
||||
for result in results {
|
||||
match result
|
||||
.map_err(BoxedError::new)
|
||||
.context(servers_error::ExecuteGrpcRequestSnafu)?
|
||||
.context(ExecuteGrpcRequestSnafu)?
|
||||
{
|
||||
Output::AffectedRows(rows) => affected_rows += rows,
|
||||
Output::Stream(_) | Output::RecordBatches(_) => {
|
||||
@@ -242,7 +242,9 @@ impl RegionServerInner {
|
||||
}
|
||||
RegionChange::Deregisters => {
|
||||
info!("Region {region_id} is deregistered from engine {engine_type}");
|
||||
self.region_map.remove(®ion_id);
|
||||
self.region_map
|
||||
.remove(®ion_id)
|
||||
.map(|(id, engine)| engine.set_writable(id, false));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -417,7 +419,7 @@ impl SchemaProvider for DummySchemaProvider {
|
||||
}
|
||||
}
|
||||
|
||||
/// For [TableProvider](datafusion::datasource::TableProvider) and [DummyCatalogList]
|
||||
/// For [TableProvider](TableProvider) and [DummyCatalogList]
|
||||
#[derive(Clone)]
|
||||
struct DummyTableProvider {
|
||||
region_id: RegionId,
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
pub mod distributed;
|
||||
mod distributed;
|
||||
mod grpc;
|
||||
mod influxdb;
|
||||
mod opentsdb;
|
||||
|
||||
@@ -111,7 +111,7 @@ impl StatementExecutor {
|
||||
let table_id = resp.table_id.context(error::UnexpectedSnafu {
|
||||
violated: "expected table_id",
|
||||
})?;
|
||||
info!("Successfully created distributed table '{table_name}' with table id {table_id}");
|
||||
info!("Successfully created table '{table_name}' with table id {table_id}");
|
||||
|
||||
table_info.ident.table_id = table_id;
|
||||
let engine = table_info.meta.engine.to_string();
|
||||
|
||||
Reference in New Issue
Block a user