mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-10-27 22:26:15 +00:00
feat(mito): Add writable flag to region (#2349)
* feat: add writable flag to region. * refactor: rename MitoEngine to MitoEngine::scanner * feat: add set_writable() to RegionEngine * feat: check whether region is writable * feat: make set_writable sync * test: test set_writable * docs: update comments * feat: send result on compaction failure * refactor: wrap output sender in new type * feat: on failure * refactor: use get_region_or/writable_region_or * refactor: remove send_result * feat: notify waiters on flush scheduler drop * test: fix tests * fix: only alter writable region
This commit is contained in:
@@ -58,6 +58,7 @@ pub enum StatusCode {
|
||||
DatabaseNotFound = 4004,
|
||||
RegionNotFound = 4005,
|
||||
RegionAlreadyExists = 4006,
|
||||
RegionReadonly = 4007,
|
||||
// ====== End of catalog related status code =======
|
||||
|
||||
// ====== Begin of storage related status code =====
|
||||
@@ -117,6 +118,7 @@ impl StatusCode {
|
||||
| StatusCode::TableNotFound
|
||||
| StatusCode::RegionNotFound
|
||||
| StatusCode::RegionAlreadyExists
|
||||
| StatusCode::RegionReadonly
|
||||
| StatusCode::TableColumnNotFound
|
||||
| StatusCode::TableColumnExists
|
||||
| StatusCode::DatabaseNotFound
|
||||
@@ -151,6 +153,7 @@ impl StatusCode {
|
||||
| StatusCode::TableNotFound
|
||||
| StatusCode::RegionNotFound
|
||||
| StatusCode::RegionAlreadyExists
|
||||
| StatusCode::RegionReadonly
|
||||
| StatusCode::TableColumnNotFound
|
||||
| StatusCode::TableColumnExists
|
||||
| StatusCode::DatabaseNotFound
|
||||
@@ -183,6 +186,7 @@ impl StatusCode {
|
||||
v if v == StatusCode::RegionAlreadyExists as u32 => {
|
||||
Some(StatusCode::RegionAlreadyExists)
|
||||
}
|
||||
v if v == StatusCode::RegionReadonly as u32 => Some(StatusCode::RegionReadonly),
|
||||
v if v == StatusCode::TableColumnNotFound as u32 => {
|
||||
Some(StatusCode::TableColumnNotFound)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user