feat: set readonly first when deregister region (#2391)

* feat: set readonly first when deregister region

* revert distxxx
This commit is contained in:
JeremyHi
2023-09-14 20:12:38 +08:00
committed by GitHub
parent a84a8ad04f
commit d1adb915bf
3 changed files with 7 additions and 5 deletions

View File

@@ -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(&region_id);
self.region_map
.remove(&region_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,

View File

@@ -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;

View File

@@ -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();