diff --git a/cpp/core/MsgsGen.cpp b/cpp/core/MsgsGen.cpp index 532aff1d..8b93a24a 100644 --- a/cpp/core/MsgsGen.cpp +++ b/cpp/core/MsgsGen.cpp @@ -550,8 +550,8 @@ std::ostream& operator<<(std::ostream& out, ShuckleMessageKind kind) { case ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK: out << "ERASE_DECOMMISSIONED_BLOCK"; break; - case ShuckleMessageKind::ALL_BLOCK_SERVICES: - out << "ALL_BLOCK_SERVICES"; + case ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED: + out << "ALL_BLOCK_SERVICES_DEPRECATED"; break; case ShuckleMessageKind::MOVE_CDC_LEADER: out << "MOVE_CDC_LEADER"; @@ -4772,35 +4772,35 @@ std::ostream& operator<<(std::ostream& out, const EraseDecommissionedBlockResp& return out; } -void AllBlockServicesReq::pack(BincodeBuf& buf) const { +void AllBlockServicesDeprecatedReq::pack(BincodeBuf& buf) const { } -void AllBlockServicesReq::unpack(BincodeBuf& buf) { +void AllBlockServicesDeprecatedReq::unpack(BincodeBuf& buf) { } -void AllBlockServicesReq::clear() { +void AllBlockServicesDeprecatedReq::clear() { } -bool AllBlockServicesReq::operator==(const AllBlockServicesReq& rhs) const { +bool AllBlockServicesDeprecatedReq::operator==(const AllBlockServicesDeprecatedReq& rhs) const { return true; } -std::ostream& operator<<(std::ostream& out, const AllBlockServicesReq& x) { - out << "AllBlockServicesReq(" << ")"; +std::ostream& operator<<(std::ostream& out, const AllBlockServicesDeprecatedReq& x) { + out << "AllBlockServicesDeprecatedReq(" << ")"; return out; } -void AllBlockServicesResp::pack(BincodeBuf& buf) const { +void AllBlockServicesDeprecatedResp::pack(BincodeBuf& buf) const { buf.packList(blockServices); } -void AllBlockServicesResp::unpack(BincodeBuf& buf) { +void AllBlockServicesDeprecatedResp::unpack(BincodeBuf& buf) { buf.unpackList(blockServices); } -void AllBlockServicesResp::clear() { +void AllBlockServicesDeprecatedResp::clear() { blockServices.clear(); } -bool AllBlockServicesResp::operator==(const AllBlockServicesResp& rhs) const { +bool AllBlockServicesDeprecatedResp::operator==(const AllBlockServicesDeprecatedResp& rhs) const { if (blockServices != rhs.blockServices) { return false; }; return true; } -std::ostream& operator<<(std::ostream& out, const AllBlockServicesResp& x) { - out << "AllBlockServicesResp(" << "BlockServices=" << x.blockServices << ")"; +std::ostream& operator<<(std::ostream& out, const AllBlockServicesDeprecatedResp& x) { + out << "AllBlockServicesDeprecatedResp(" << "BlockServices=" << x.blockServices << ")"; return out; } @@ -8520,12 +8520,12 @@ EraseDecommissionedBlockReq& ShuckleReqContainer::setEraseDecommissionedBlock() auto& x = _data.emplace<23>(); return x; } -const AllBlockServicesReq& ShuckleReqContainer::getAllBlockServices() const { - ALWAYS_ASSERT(_kind == ShuckleMessageKind::ALL_BLOCK_SERVICES, "%s != %s", _kind, ShuckleMessageKind::ALL_BLOCK_SERVICES); +const AllBlockServicesDeprecatedReq& ShuckleReqContainer::getAllBlockServicesDeprecated() const { + ALWAYS_ASSERT(_kind == ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED, "%s != %s", _kind, ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED); return std::get<24>(_data); } -AllBlockServicesReq& ShuckleReqContainer::setAllBlockServices() { - _kind = ShuckleMessageKind::ALL_BLOCK_SERVICES; +AllBlockServicesDeprecatedReq& ShuckleReqContainer::setAllBlockServicesDeprecated() { + _kind = ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED; auto& x = _data.emplace<24>(); return x; } @@ -8636,8 +8636,8 @@ void ShuckleReqContainer::operator=(const ShuckleReqContainer& other) { case ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK: setEraseDecommissionedBlock() = other.getEraseDecommissionedBlock(); break; - case ShuckleMessageKind::ALL_BLOCK_SERVICES: - setAllBlockServices() = other.getAllBlockServices(); + case ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED: + setAllBlockServicesDeprecated() = other.getAllBlockServicesDeprecated(); break; case ShuckleMessageKind::MOVE_CDC_LEADER: setMoveCdcLeader() = other.getMoveCdcLeader(); @@ -8706,7 +8706,7 @@ size_t ShuckleReqContainer::packedSize() const { return sizeof(ShuckleMessageKind) + std::get<22>(_data).packedSize(); case ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK: return sizeof(ShuckleMessageKind) + std::get<23>(_data).packedSize(); - case ShuckleMessageKind::ALL_BLOCK_SERVICES: + case ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED: return sizeof(ShuckleMessageKind) + std::get<24>(_data).packedSize(); case ShuckleMessageKind::MOVE_CDC_LEADER: return sizeof(ShuckleMessageKind) + std::get<25>(_data).packedSize(); @@ -8792,7 +8792,7 @@ void ShuckleReqContainer::pack(BincodeBuf& buf) const { case ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK: std::get<23>(_data).pack(buf); break; - case ShuckleMessageKind::ALL_BLOCK_SERVICES: + case ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED: std::get<24>(_data).pack(buf); break; case ShuckleMessageKind::MOVE_CDC_LEADER: @@ -8881,7 +8881,7 @@ void ShuckleReqContainer::unpack(BincodeBuf& buf) { case ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK: _data.emplace<23>().unpack(buf); break; - case ShuckleMessageKind::ALL_BLOCK_SERVICES: + case ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED: _data.emplace<24>().unpack(buf); break; case ShuckleMessageKind::MOVE_CDC_LEADER: @@ -8947,8 +8947,8 @@ bool ShuckleReqContainer::operator==(const ShuckleReqContainer& other) const { return getAllCdc() == other.getAllCdc(); case ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK: return getEraseDecommissionedBlock() == other.getEraseDecommissionedBlock(); - case ShuckleMessageKind::ALL_BLOCK_SERVICES: - return getAllBlockServices() == other.getAllBlockServices(); + case ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED: + return getAllBlockServicesDeprecated() == other.getAllBlockServicesDeprecated(); case ShuckleMessageKind::MOVE_CDC_LEADER: return getMoveCdcLeader() == other.getMoveCdcLeader(); case ShuckleMessageKind::CLEAR_CDC_INFO: @@ -9032,8 +9032,8 @@ std::ostream& operator<<(std::ostream& out, const ShuckleReqContainer& x) { case ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK: out << x.getEraseDecommissionedBlock(); break; - case ShuckleMessageKind::ALL_BLOCK_SERVICES: - out << x.getAllBlockServices(); + case ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED: + out << x.getAllBlockServicesDeprecated(); break; case ShuckleMessageKind::MOVE_CDC_LEADER: out << x.getMoveCdcLeader(); @@ -9275,12 +9275,12 @@ EraseDecommissionedBlockResp& ShuckleRespContainer::setEraseDecommissionedBlock( auto& x = _data.emplace<24>(); return x; } -const AllBlockServicesResp& ShuckleRespContainer::getAllBlockServices() const { - ALWAYS_ASSERT(_kind == ShuckleMessageKind::ALL_BLOCK_SERVICES, "%s != %s", _kind, ShuckleMessageKind::ALL_BLOCK_SERVICES); +const AllBlockServicesDeprecatedResp& ShuckleRespContainer::getAllBlockServicesDeprecated() const { + ALWAYS_ASSERT(_kind == ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED, "%s != %s", _kind, ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED); return std::get<25>(_data); } -AllBlockServicesResp& ShuckleRespContainer::setAllBlockServices() { - _kind = ShuckleMessageKind::ALL_BLOCK_SERVICES; +AllBlockServicesDeprecatedResp& ShuckleRespContainer::setAllBlockServicesDeprecated() { + _kind = ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED; auto& x = _data.emplace<25>(); return x; } @@ -9394,8 +9394,8 @@ void ShuckleRespContainer::operator=(const ShuckleRespContainer& other) { case ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK: setEraseDecommissionedBlock() = other.getEraseDecommissionedBlock(); break; - case ShuckleMessageKind::ALL_BLOCK_SERVICES: - setAllBlockServices() = other.getAllBlockServices(); + case ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED: + setAllBlockServicesDeprecated() = other.getAllBlockServicesDeprecated(); break; case ShuckleMessageKind::MOVE_CDC_LEADER: setMoveCdcLeader() = other.getMoveCdcLeader(); @@ -9466,7 +9466,7 @@ size_t ShuckleRespContainer::packedSize() const { return sizeof(ShuckleMessageKind) + std::get<23>(_data).packedSize(); case ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK: return sizeof(ShuckleMessageKind) + std::get<24>(_data).packedSize(); - case ShuckleMessageKind::ALL_BLOCK_SERVICES: + case ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED: return sizeof(ShuckleMessageKind) + std::get<25>(_data).packedSize(); case ShuckleMessageKind::MOVE_CDC_LEADER: return sizeof(ShuckleMessageKind) + std::get<26>(_data).packedSize(); @@ -9555,7 +9555,7 @@ void ShuckleRespContainer::pack(BincodeBuf& buf) const { case ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK: std::get<24>(_data).pack(buf); break; - case ShuckleMessageKind::ALL_BLOCK_SERVICES: + case ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED: std::get<25>(_data).pack(buf); break; case ShuckleMessageKind::MOVE_CDC_LEADER: @@ -9647,7 +9647,7 @@ void ShuckleRespContainer::unpack(BincodeBuf& buf) { case ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK: _data.emplace<24>().unpack(buf); break; - case ShuckleMessageKind::ALL_BLOCK_SERVICES: + case ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED: _data.emplace<25>().unpack(buf); break; case ShuckleMessageKind::MOVE_CDC_LEADER: @@ -9715,8 +9715,8 @@ bool ShuckleRespContainer::operator==(const ShuckleRespContainer& other) const { return getAllCdc() == other.getAllCdc(); case ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK: return getEraseDecommissionedBlock() == other.getEraseDecommissionedBlock(); - case ShuckleMessageKind::ALL_BLOCK_SERVICES: - return getAllBlockServices() == other.getAllBlockServices(); + case ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED: + return getAllBlockServicesDeprecated() == other.getAllBlockServicesDeprecated(); case ShuckleMessageKind::MOVE_CDC_LEADER: return getMoveCdcLeader() == other.getMoveCdcLeader(); case ShuckleMessageKind::CLEAR_CDC_INFO: @@ -9803,8 +9803,8 @@ std::ostream& operator<<(std::ostream& out, const ShuckleRespContainer& x) { case ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK: out << x.getEraseDecommissionedBlock(); break; - case ShuckleMessageKind::ALL_BLOCK_SERVICES: - out << x.getAllBlockServices(); + case ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED: + out << x.getAllBlockServicesDeprecated(); break; case ShuckleMessageKind::MOVE_CDC_LEADER: out << x.getMoveCdcLeader(); diff --git a/cpp/core/MsgsGen.hpp b/cpp/core/MsgsGen.hpp index 748dc4cf..f66551eb 100644 --- a/cpp/core/MsgsGen.hpp +++ b/cpp/core/MsgsGen.hpp @@ -350,7 +350,7 @@ enum class ShuckleMessageKind : uint8_t { SHARD_BLOCK_SERVICES = 24, ALL_CDC = 25, ERASE_DECOMMISSIONED_BLOCK = 32, - ALL_BLOCK_SERVICES = 33, + ALL_BLOCK_SERVICES_DEPRECATED = 33, MOVE_CDC_LEADER = 35, CLEAR_CDC_INFO = 36, EMPTY = 255, @@ -381,7 +381,7 @@ const std::vector allShuckleMessageKind { ShuckleMessageKind::SHARD_BLOCK_SERVICES, ShuckleMessageKind::ALL_CDC, ShuckleMessageKind::ERASE_DECOMMISSIONED_BLOCK, - ShuckleMessageKind::ALL_BLOCK_SERVICES, + ShuckleMessageKind::ALL_BLOCK_SERVICES_DEPRECATED, ShuckleMessageKind::MOVE_CDC_LEADER, ShuckleMessageKind::CLEAR_CDC_INFO, }; @@ -4521,11 +4521,11 @@ struct EraseDecommissionedBlockResp { std::ostream& operator<<(std::ostream& out, const EraseDecommissionedBlockResp& x); -struct AllBlockServicesReq { +struct AllBlockServicesDeprecatedReq { static constexpr uint16_t STATIC_SIZE = 0; // - AllBlockServicesReq() { clear(); } + AllBlockServicesDeprecatedReq() { clear(); } size_t packedSize() const { size_t _size = 0; return _size; @@ -4533,17 +4533,17 @@ struct AllBlockServicesReq { void pack(BincodeBuf& buf) const; void unpack(BincodeBuf& buf); void clear(); - bool operator==(const AllBlockServicesReq&rhs) const; + bool operator==(const AllBlockServicesDeprecatedReq&rhs) const; }; -std::ostream& operator<<(std::ostream& out, const AllBlockServicesReq& x); +std::ostream& operator<<(std::ostream& out, const AllBlockServicesDeprecatedReq& x); -struct AllBlockServicesResp { +struct AllBlockServicesDeprecatedResp { BincodeList blockServices; static constexpr uint16_t STATIC_SIZE = BincodeList::STATIC_SIZE; // blockServices - AllBlockServicesResp() { clear(); } + AllBlockServicesDeprecatedResp() { clear(); } size_t packedSize() const { size_t _size = 0; _size += blockServices.packedSize(); // blockServices @@ -4552,10 +4552,10 @@ struct AllBlockServicesResp { void pack(BincodeBuf& buf) const; void unpack(BincodeBuf& buf); void clear(); - bool operator==(const AllBlockServicesResp&rhs) const; + bool operator==(const AllBlockServicesDeprecatedResp&rhs) const; }; -std::ostream& operator<<(std::ostream& out, const AllBlockServicesResp& x); +std::ostream& operator<<(std::ostream& out, const AllBlockServicesDeprecatedResp& x); struct MoveCdcLeaderReq { ReplicaId replica; @@ -5479,9 +5479,9 @@ std::ostream& operator<<(std::ostream& out, const CDCRespContainer& x); struct ShuckleReqContainer { private: - static constexpr std::array _staticSizes = {LocalShardsReq::STATIC_SIZE, LocalCdcReq::STATIC_SIZE, InfoReq::STATIC_SIZE, ShuckleReq::STATIC_SIZE, LocalChangedBlockServicesReq::STATIC_SIZE, CreateLocationReq::STATIC_SIZE, RenameLocationReq::STATIC_SIZE, LocationsReq::STATIC_SIZE, RegisterShardReq::STATIC_SIZE, RegisterCdcReq::STATIC_SIZE, SetBlockServiceFlagsReq::STATIC_SIZE, RegisterBlockServicesReq::STATIC_SIZE, ChangedBlockServicesAtLocationReq::STATIC_SIZE, ShardsAtLocationReq::STATIC_SIZE, CdcAtLocationReq::STATIC_SIZE, ShardBlockServicesDEPRECATEDReq::STATIC_SIZE, CdcReplicasDEPRECATEDReq::STATIC_SIZE, AllShardsReq::STATIC_SIZE, DecommissionBlockServiceReq::STATIC_SIZE, MoveShardLeaderReq::STATIC_SIZE, ClearShardInfoReq::STATIC_SIZE, ShardBlockServicesReq::STATIC_SIZE, AllCdcReq::STATIC_SIZE, EraseDecommissionedBlockReq::STATIC_SIZE, AllBlockServicesReq::STATIC_SIZE, MoveCdcLeaderReq::STATIC_SIZE, ClearCdcInfoReq::STATIC_SIZE}; + static constexpr std::array _staticSizes = {LocalShardsReq::STATIC_SIZE, LocalCdcReq::STATIC_SIZE, InfoReq::STATIC_SIZE, ShuckleReq::STATIC_SIZE, LocalChangedBlockServicesReq::STATIC_SIZE, CreateLocationReq::STATIC_SIZE, RenameLocationReq::STATIC_SIZE, LocationsReq::STATIC_SIZE, RegisterShardReq::STATIC_SIZE, RegisterCdcReq::STATIC_SIZE, SetBlockServiceFlagsReq::STATIC_SIZE, RegisterBlockServicesReq::STATIC_SIZE, ChangedBlockServicesAtLocationReq::STATIC_SIZE, ShardsAtLocationReq::STATIC_SIZE, CdcAtLocationReq::STATIC_SIZE, ShardBlockServicesDEPRECATEDReq::STATIC_SIZE, CdcReplicasDEPRECATEDReq::STATIC_SIZE, AllShardsReq::STATIC_SIZE, DecommissionBlockServiceReq::STATIC_SIZE, MoveShardLeaderReq::STATIC_SIZE, ClearShardInfoReq::STATIC_SIZE, ShardBlockServicesReq::STATIC_SIZE, AllCdcReq::STATIC_SIZE, EraseDecommissionedBlockReq::STATIC_SIZE, AllBlockServicesDeprecatedReq::STATIC_SIZE, MoveCdcLeaderReq::STATIC_SIZE, ClearCdcInfoReq::STATIC_SIZE}; ShuckleMessageKind _kind = ShuckleMessageKind::EMPTY; - std::variant _data; + std::variant _data; public: ShuckleReqContainer(); ShuckleReqContainer(const ShuckleReqContainer& other); @@ -5539,8 +5539,8 @@ public: AllCdcReq& setAllCdc(); const EraseDecommissionedBlockReq& getEraseDecommissionedBlock() const; EraseDecommissionedBlockReq& setEraseDecommissionedBlock(); - const AllBlockServicesReq& getAllBlockServices() const; - AllBlockServicesReq& setAllBlockServices(); + const AllBlockServicesDeprecatedReq& getAllBlockServicesDeprecated() const; + AllBlockServicesDeprecatedReq& setAllBlockServicesDeprecated(); const MoveCdcLeaderReq& getMoveCdcLeader() const; MoveCdcLeaderReq& setMoveCdcLeader(); const ClearCdcInfoReq& getClearCdcInfo() const; @@ -5559,9 +5559,9 @@ std::ostream& operator<<(std::ostream& out, const ShuckleReqContainer& x); struct ShuckleRespContainer { private: - static constexpr std::array _staticSizes = {sizeof(EggsError), LocalShardsResp::STATIC_SIZE, LocalCdcResp::STATIC_SIZE, InfoResp::STATIC_SIZE, ShuckleResp::STATIC_SIZE, LocalChangedBlockServicesResp::STATIC_SIZE, CreateLocationResp::STATIC_SIZE, RenameLocationResp::STATIC_SIZE, LocationsResp::STATIC_SIZE, RegisterShardResp::STATIC_SIZE, RegisterCdcResp::STATIC_SIZE, SetBlockServiceFlagsResp::STATIC_SIZE, RegisterBlockServicesResp::STATIC_SIZE, ChangedBlockServicesAtLocationResp::STATIC_SIZE, ShardsAtLocationResp::STATIC_SIZE, CdcAtLocationResp::STATIC_SIZE, ShardBlockServicesDEPRECATEDResp::STATIC_SIZE, CdcReplicasDEPRECATEDResp::STATIC_SIZE, AllShardsResp::STATIC_SIZE, DecommissionBlockServiceResp::STATIC_SIZE, MoveShardLeaderResp::STATIC_SIZE, ClearShardInfoResp::STATIC_SIZE, ShardBlockServicesResp::STATIC_SIZE, AllCdcResp::STATIC_SIZE, EraseDecommissionedBlockResp::STATIC_SIZE, AllBlockServicesResp::STATIC_SIZE, MoveCdcLeaderResp::STATIC_SIZE, ClearCdcInfoResp::STATIC_SIZE}; + static constexpr std::array _staticSizes = {sizeof(EggsError), LocalShardsResp::STATIC_SIZE, LocalCdcResp::STATIC_SIZE, InfoResp::STATIC_SIZE, ShuckleResp::STATIC_SIZE, LocalChangedBlockServicesResp::STATIC_SIZE, CreateLocationResp::STATIC_SIZE, RenameLocationResp::STATIC_SIZE, LocationsResp::STATIC_SIZE, RegisterShardResp::STATIC_SIZE, RegisterCdcResp::STATIC_SIZE, SetBlockServiceFlagsResp::STATIC_SIZE, RegisterBlockServicesResp::STATIC_SIZE, ChangedBlockServicesAtLocationResp::STATIC_SIZE, ShardsAtLocationResp::STATIC_SIZE, CdcAtLocationResp::STATIC_SIZE, ShardBlockServicesDEPRECATEDResp::STATIC_SIZE, CdcReplicasDEPRECATEDResp::STATIC_SIZE, AllShardsResp::STATIC_SIZE, DecommissionBlockServiceResp::STATIC_SIZE, MoveShardLeaderResp::STATIC_SIZE, ClearShardInfoResp::STATIC_SIZE, ShardBlockServicesResp::STATIC_SIZE, AllCdcResp::STATIC_SIZE, EraseDecommissionedBlockResp::STATIC_SIZE, AllBlockServicesDeprecatedResp::STATIC_SIZE, MoveCdcLeaderResp::STATIC_SIZE, ClearCdcInfoResp::STATIC_SIZE}; ShuckleMessageKind _kind = ShuckleMessageKind::EMPTY; - std::variant _data; + std::variant _data; public: ShuckleRespContainer(); ShuckleRespContainer(const ShuckleRespContainer& other); @@ -5621,8 +5621,8 @@ public: AllCdcResp& setAllCdc(); const EraseDecommissionedBlockResp& getEraseDecommissionedBlock() const; EraseDecommissionedBlockResp& setEraseDecommissionedBlock(); - const AllBlockServicesResp& getAllBlockServices() const; - AllBlockServicesResp& setAllBlockServices(); + const AllBlockServicesDeprecatedResp& getAllBlockServicesDeprecated() const; + AllBlockServicesDeprecatedResp& setAllBlockServicesDeprecated(); const MoveCdcLeaderResp& getMoveCdcLeader() const; MoveCdcLeaderResp& setMoveCdcLeader(); const ClearCdcInfoResp& getClearCdcInfo() const; diff --git a/cpp/core/Shuckle.cpp b/cpp/core/Shuckle.cpp index 0ed04aa0..f7e066ec 100644 --- a/cpp/core/Shuckle.cpp +++ b/cpp/core/Shuckle.cpp @@ -135,7 +135,7 @@ std::pair fetchBlockServices(const std::string& addr, uint16_t // all block services { ShuckleReqContainer reqContainer; - auto& req = reqContainer.setAllBlockServices(); + auto& req = reqContainer.setAllBlockServicesDeprecated(); { const auto [err, errStr] = writeShuckleRequest(sock.get(), reqContainer, timeout); if (err) { FAIL(err, errStr); } @@ -147,7 +147,7 @@ std::pair fetchBlockServices(const std::string& addr, uint16_t if (err) { FAIL(err, errStr); } } - blockServices = respContainer.getAllBlockServices().blockServices.els; + blockServices = respContainer.getAllBlockServicesDeprecated().blockServices.els; } // current block services diff --git a/go/bincodegen/bincodegen.go b/go/bincodegen/bincodegen.go index 1fab6ba2..22eb0079 100644 --- a/go/bincodegen/bincodegen.go +++ b/go/bincodegen/bincodegen.go @@ -1945,8 +1945,8 @@ func main() { }, { 0x21, - reflect.TypeOf(msgs.AllBlockServicesReq{}), - reflect.TypeOf(msgs.AllBlockServicesResp{}), + reflect.TypeOf(msgs.AllBlockServicesDeprecatedReq{}), + reflect.TypeOf(msgs.AllBlockServicesDeprecatedResp{}), }, { 0x23, diff --git a/go/cleanup/migrate.go b/go/cleanup/migrate.go index 750eb4a1..3cfd34a6 100644 --- a/go/cleanup/migrate.go +++ b/go/cleanup/migrate.go @@ -648,13 +648,14 @@ OUT: } m.cleanVisitedBlockService() m.log.Debug("requesting block services") - blockServicesResp, err := client.ShuckleRequest(m.log, nil, m.shuckleAddress, &msgs.AllBlockServicesReq{}) + blockServicesResp, err := client.ShuckleRequest(m.log, nil, m.shuckleAddress, &msgs.AllBlockServicesDeprecatedReq{}) if err != nil { m.log.RaiseNC(shuckleResponseAlert, "error getting block services from shuckle: %v", err) } else { m.log.ClearNC(shuckleResponseAlert) - blockServices := blockServicesResp.(*msgs.AllBlockServicesResp) + blockServices := blockServicesResp.(*msgs.AllBlockServicesDeprecatedResp) for _, bs := range blockServices.BlockServices { + if m.failureDomainFilter != "" && (bs.FailureDomain.String() != m.failureDomainFilter) { continue } diff --git a/go/client/client.go b/go/client/client.go index 945ba38e..104f39b6 100644 --- a/go/client/client.go +++ b/go/client/client.go @@ -1015,11 +1015,11 @@ func (c *Client) refreshAddrs(log *lib.Logger) error { return nil } - blockServicesResp, err := c.shuckleConn.Request(&msgs.AllBlockServicesReq{}) + blockServicesResp, err := c.shuckleConn.Request(&msgs.AllBlockServicesDeprecatedReq{}) if err != nil { return fmt.Errorf("could not request block services from shuckle: %w", err) } - blockServices := blockServicesResp.(*msgs.AllBlockServicesResp) + blockServices := blockServicesResp.(*msgs.AllBlockServicesDeprecatedResp) var blockServicesToAdd []msgs.BlacklistEntry func () { diff --git a/go/client/shucklereq.go b/go/client/shucklereq.go index 3ad93412..1b51361b 100644 --- a/go/client/shucklereq.go +++ b/go/client/shucklereq.go @@ -67,8 +67,8 @@ func readShuckleResponse( resp = &msgs.LocalShardsResp{} case msgs.REGISTER_SHARD: resp = &msgs.RegisterShardResp{} - case msgs.ALL_BLOCK_SERVICES: - resp = &msgs.AllBlockServicesResp{} + case msgs.ALL_BLOCK_SERVICES_DEPRECATED: + resp = &msgs.AllBlockServicesDeprecatedResp{} case msgs.SET_BLOCK_SERVICE_FLAGS: resp = &msgs.SetBlockServiceFlagsResp{} case msgs.DECOMMISSION_BLOCK_SERVICE: diff --git a/go/client/waitshuckle.go b/go/client/waitshuckle.go index 735a5613..65d30bf1 100644 --- a/go/client/waitshuckle.go +++ b/go/client/waitshuckle.go @@ -12,12 +12,12 @@ func WaitForBlockServices(ll *lib.Logger, shuckleAddress string, expectedBlockSe for { var resp msgs.ShuckleResponse var bss []msgs.BlockServiceInfo - resp, err = ShuckleRequest(ll, nil, shuckleAddress, &msgs.AllBlockServicesReq{}) + resp, err = ShuckleRequest(ll, nil, shuckleAddress, &msgs.AllBlockServicesDeprecatedReq{}) if err != nil { ll.Debug("got error while getting block services from shuckle, will keep waiting: %v", err) goto KeepChecking } - bss = resp.(*msgs.AllBlockServicesResp).BlockServices + bss = resp.(*msgs.AllBlockServicesDeprecatedResp).BlockServices if len(bss) < expectedBlockServices { err = fmt.Errorf("not all block services are up yet, will keep waiting") ll.Debug("%v", err) diff --git a/go/eggsblocks/eggsblocks.go b/go/eggsblocks/eggsblocks.go index ef1a335a..da430e99 100644 --- a/go/eggsblocks/eggsblocks.go +++ b/go/eggsblocks/eggsblocks.go @@ -1559,12 +1559,12 @@ func main() { alert := log.NewNCAlert(0) log.RaiseNC(alert, "fetching block services") - resp, err := env.shuckleConn.Request(&msgs.AllBlockServicesReq{}) + resp, err := env.shuckleConn.Request(&msgs.AllBlockServicesDeprecatedReq{}) if err != nil { panic(fmt.Errorf("could not request block services from shuckle: %v", err)) } log.ClearNC(alert) - shuckleBlockServices = resp.(*msgs.AllBlockServicesResp).BlockServices + shuckleBlockServices = resp.(*msgs.AllBlockServicesDeprecatedResp).BlockServices } for i := range shuckleBlockServices { bs := &shuckleBlockServices[i] diff --git a/go/eggscli/eggscli.go b/go/eggscli/eggscli.go index 034aba98..5bf9b6dc 100644 --- a/go/eggscli/eggscli.go +++ b/go/eggscli/eggscli.go @@ -373,11 +373,11 @@ func main() { os.Exit(2) } log.Info("requesting block services") - blockServicesResp, err := client.ShuckleRequest(log, nil, *shuckleAddress, &msgs.AllBlockServicesReq{}) + blockServicesResp, err := client.ShuckleRequest(log, nil, *shuckleAddress, &msgs.AllBlockServicesDeprecatedReq{}) if err != nil { panic(err) } - blockServices := blockServicesResp.(*msgs.AllBlockServicesResp) + blockServices := blockServicesResp.(*msgs.AllBlockServicesDeprecatedResp) blockServicesToMigrate := make(map[string]*[]msgs.BlockServiceId) // by failure domain numBlockServicesToMigrate := 0 for _, bs := range blockServices.BlockServices { @@ -643,11 +643,11 @@ func main() { blockReqBlockService := blockReqCmd.Uint64("bs", 0, "Block service") blockReqFile := blockReqCmd.String("file", "", "") blockReqRun := func() { - resp, err := client.ShuckleRequest(log, nil, *shuckleAddress, &msgs.AllBlockServicesReq{}) + resp, err := client.ShuckleRequest(log, nil, *shuckleAddress, &msgs.AllBlockServicesDeprecatedReq{}) if err != nil { panic(err) } - blockServices := resp.(*msgs.AllBlockServicesResp) + blockServices := resp.(*msgs.AllBlockServicesDeprecatedResp) var blockServiceInfo msgs.BlockServiceInfo for _, bsInfo := range blockServices.BlockServices { if bsInfo.Id == msgs.BlockServiceId(*blockReqBlockService) { @@ -680,11 +680,11 @@ func main() { testBlockWriteBlockService := testBlockWriteCmd.String("bs", "", "Block service. If comma-separated, they'll be written in parallel to the specified ones.") testBlockWriteSize := testBlockWriteCmd.Uint("size", 0, "Size (must fit in u32)") testBlockWriteRun := func() { - resp, err := client.ShuckleRequest(log, nil, *shuckleAddress, &msgs.AllBlockServicesReq{}) + resp, err := client.ShuckleRequest(log, nil, *shuckleAddress, &msgs.AllBlockServicesDeprecatedReq{}) if err != nil { panic(err) } - blockServices := resp.(*msgs.AllBlockServicesResp) + blockServices := resp.(*msgs.AllBlockServicesDeprecatedResp) bsInfos := []msgs.BlockServiceInfo{} for _, str := range strings.Split(*testBlockWriteBlockService, ",") { bsId, err := strconv.ParseUint(str, 0, 64) @@ -762,11 +762,11 @@ func main() { } if *blockserviceFlagsFailureDomain != "" { log.Info("requesting block services") - blockServicesResp, err := client.ShuckleRequest(log, nil, *shuckleAddress, &msgs.AllBlockServicesReq{}) + blockServicesResp, err := client.ShuckleRequest(log, nil, *shuckleAddress, &msgs.AllBlockServicesDeprecatedReq{}) if err != nil { panic(err) } - blockServices := blockServicesResp.(*msgs.AllBlockServicesResp) + blockServices := blockServicesResp.(*msgs.AllBlockServicesDeprecatedResp) for _, bs := range blockServices.BlockServices { if bs.FailureDomain.String() == *blockserviceFlagsFailureDomain { blockServiceIds = append(blockServiceIds, bs.Id) diff --git a/go/eggsshuckle/eggsshuckle.go b/go/eggsshuckle/eggsshuckle.go index 6c343b01..80ede6de 100644 --- a/go/eggsshuckle/eggsshuckle.go +++ b/go/eggsshuckle/eggsshuckle.go @@ -648,8 +648,8 @@ func assignWritableBlockServicesToShards(log *lib.Logger, s *state) { } } -func handleAllBlockServices(ll *lib.Logger, s *state, req *msgs.AllBlockServicesReq) (*msgs.AllBlockServicesResp, error) { - resp := msgs.AllBlockServicesResp{} +func handleAllBlockServices(ll *lib.Logger, s *state, req *msgs.AllBlockServicesDeprecatedReq) (*msgs.AllBlockServicesDeprecatedResp, error) { + resp := msgs.AllBlockServicesDeprecatedResp{} blockServices, err := s.selectBlockServices(nil, nil, 0, 0, msgs.Now(), false) if err != nil { ll.RaiseAlert("error reading block services: %s", err) @@ -1498,7 +1498,7 @@ func handleRequestParsed(log *lib.Logger, s *state, req msgs.ShuckleRequest) (ms resp, err = handleAllShards(log, s, whichReq) case *msgs.RegisterShardReq: resp, err = handleRegisterShard(log, s, whichReq) - case *msgs.AllBlockServicesReq: + case *msgs.AllBlockServicesDeprecatedReq: resp, err = handleAllBlockServices(log, s, whichReq) case *msgs.LocalChangedBlockServicesReq: resp, err = handleLocalChangedBlockServices(log, s, whichReq) @@ -1663,8 +1663,8 @@ func readShuckleRequest( req = &msgs.LocalShardsReq{} case msgs.REGISTER_SHARD: req = &msgs.RegisterShardReq{} - case msgs.ALL_BLOCK_SERVICES: - req = &msgs.AllBlockServicesReq{} + case msgs.ALL_BLOCK_SERVICES_DEPRECATED: + req = &msgs.AllBlockServicesDeprecatedReq{} case msgs.LOCAL_CHANGED_BLOCK_SERVICES: req = &msgs.LocalChangedBlockServicesReq{} case msgs.DECOMMISSION_BLOCK_SERVICE: diff --git a/go/eggsshuckle/scripts.js b/go/eggsshuckle/scripts.js index c111eeeb..9b09835a 100644 --- a/go/eggsshuckle/scripts.js +++ b/go/eggsshuckle/scripts.js @@ -347,7 +347,7 @@ export function renderIndex() { const [blockServices, setBlockServices] = useState(null); const [locations, setLocations] = useState(null); useEffect(async () => { - const resp = await shuckleReq('ALL_BLOCK_SERVICES', {}); + const resp = await shuckleReq('ALL_BLOCK_SERVICES_DEPRECATED', {}); setBlockServices(resp); }, []); diff --git a/go/eggsshucklebeacon/eggsshucklebeacon.go b/go/eggsshucklebeacon/eggsshucklebeacon.go index c3f017c1..6647a119 100644 --- a/go/eggsshucklebeacon/eggsshucklebeacon.go +++ b/go/eggsshucklebeacon/eggsshucklebeacon.go @@ -112,8 +112,8 @@ func readShuckleRequest( req = &msgs.LocalShardsReq{} case msgs.REGISTER_SHARD: req = &msgs.RegisterShardReq{} - case msgs.ALL_BLOCK_SERVICES: - req = &msgs.AllBlockServicesReq{} + case msgs.ALL_BLOCK_SERVICES_DEPRECATED: + req = &msgs.AllBlockServicesDeprecatedReq{} case msgs.LOCAL_CHANGED_BLOCK_SERVICES: req = &msgs.LocalChangedBlockServicesReq{} case msgs.DECOMMISSION_BLOCK_SERVICE: diff --git a/go/eggsshuckleproxy/eggsshuckleproxy.go b/go/eggsshuckleproxy/eggsshuckleproxy.go index 1cd95ca4..f9deebcd 100644 --- a/go/eggsshuckleproxy/eggsshuckleproxy.go +++ b/go/eggsshuckleproxy/eggsshuckleproxy.go @@ -112,7 +112,7 @@ func handleRequestParsed(log *lib.Logger, s *state, req msgs.ShuckleRequest) (ms resp, err = handleProxyRequest(log, s, req) case *msgs.RegisterShardReq: resp, err = handleProxyRequest(log, s, req) - case *msgs.AllBlockServicesReq: + case *msgs.AllBlockServicesDeprecatedReq: resp, err = handleProxyRequest(log, s, req) case *msgs.LocalChangedBlockServicesReq: resp, err = handleLocalChangedBlockServices(log, s, whichReq) @@ -273,8 +273,8 @@ func readShuckleRequest( req = &msgs.LocalShardsReq{} case msgs.REGISTER_SHARD: req = &msgs.RegisterShardReq{} - case msgs.ALL_BLOCK_SERVICES: - req = &msgs.AllBlockServicesReq{} + case msgs.ALL_BLOCK_SERVICES_DEPRECATED: + req = &msgs.AllBlockServicesDeprecatedReq{} case msgs.LOCAL_CHANGED_BLOCK_SERVICES: req = &msgs.LocalChangedBlockServicesReq{} case msgs.DECOMMISSION_BLOCK_SERVICE: diff --git a/go/eggstests/fstest.go b/go/eggstests/fstest.go index e10e7abc..c1a81cc8 100644 --- a/go/eggstests/fstest.go +++ b/go/eggstests/fstest.go @@ -669,11 +669,11 @@ func corruptFiles( ) uint64 { blockServicesToDataDirs := make(map[msgs.BlockServiceId]string) { - resp, err := client.ShuckleRequest(log, nil, shuckleAddress, &msgs.AllBlockServicesReq{}) + resp, err := client.ShuckleRequest(log, nil, shuckleAddress, &msgs.AllBlockServicesDeprecatedReq{}) if err != nil { panic(err) } - body := resp.(*msgs.AllBlockServicesResp) + body := resp.(*msgs.AllBlockServicesDeprecatedResp) for _, block := range body.BlockServices { blockServicesToDataDirs[block.Id] = strings.Split(block.Path, ":")[1] } @@ -955,11 +955,11 @@ func fsTestInternal[Id comparable]( panic(err) } // check that we have no flash block - blockServicesResp, err := client.ShuckleRequest(log, nil, shuckleAddress, &msgs.AllBlockServicesReq{}) + blockServicesResp, err := client.ShuckleRequest(log, nil, shuckleAddress, &msgs.AllBlockServicesDeprecatedReq{}) if err != nil { panic(err) } - blockServices := blockServicesResp.(*msgs.AllBlockServicesResp) + blockServices := blockServicesResp.(*msgs.AllBlockServicesDeprecatedResp) blockServicesById := make(map[msgs.BlockServiceId]*msgs.BlockServiceInfo) for i := range blockServices.BlockServices { blockServicesById[blockServices.BlockServices[i].Id] = &blockServices.BlockServices[i] diff --git a/go/msgs/msgs.go b/go/msgs/msgs.go index 3cf2707c..df9f9339 100644 --- a/go/msgs/msgs.go +++ b/go/msgs/msgs.go @@ -2053,9 +2053,9 @@ type SetBlockServiceFlagsReq struct { type SetBlockServiceFlagsResp struct{} -type AllBlockServicesReq struct{} +type AllBlockServicesDeprecatedReq struct{} -type AllBlockServicesResp struct { +type AllBlockServicesDeprecatedResp struct { BlockServices []BlockServiceInfo } diff --git a/go/msgs/msgs_bincode.go b/go/msgs/msgs_bincode.go index 76ee7d62..1fa6ac5c 100644 --- a/go/msgs/msgs_bincode.go +++ b/go/msgs/msgs_bincode.go @@ -845,7 +845,7 @@ func (k ShuckleMessageKind) String() string { case 32: return "ERASE_DECOMMISSIONED_BLOCK" case 33: - return "ALL_BLOCK_SERVICES" + return "ALL_BLOCK_SERVICES_DEPRECATED" case 35: return "MOVE_CDC_LEADER" case 36: @@ -881,7 +881,7 @@ const ( SHARD_BLOCK_SERVICES ShuckleMessageKind = 0x18 ALL_CDC ShuckleMessageKind = 0x19 ERASE_DECOMMISSIONED_BLOCK ShuckleMessageKind = 0x20 - ALL_BLOCK_SERVICES ShuckleMessageKind = 0x21 + ALL_BLOCK_SERVICES_DEPRECATED ShuckleMessageKind = 0x21 MOVE_CDC_LEADER ShuckleMessageKind = 0x23 CLEAR_CDC_INFO ShuckleMessageKind = 0x24 ) @@ -911,7 +911,7 @@ var AllShuckleMessageKind = [...]ShuckleMessageKind{ SHARD_BLOCK_SERVICES, ALL_CDC, ERASE_DECOMMISSIONED_BLOCK, - ALL_BLOCK_SERVICES, + ALL_BLOCK_SERVICES_DEPRECATED, MOVE_CDC_LEADER, CLEAR_CDC_INFO, } @@ -968,8 +968,8 @@ func MkShuckleMessage(k string) (ShuckleRequest, ShuckleResponse, error) { return &AllCdcReq{}, &AllCdcResp{}, nil case k == "ERASE_DECOMMISSIONED_BLOCK": return &EraseDecommissionedBlockReq{}, &EraseDecommissionedBlockResp{}, nil - case k == "ALL_BLOCK_SERVICES": - return &AllBlockServicesReq{}, &AllBlockServicesResp{}, nil + case k == "ALL_BLOCK_SERVICES_DEPRECATED": + return &AllBlockServicesDeprecatedReq{}, &AllBlockServicesDeprecatedResp{}, nil case k == "MOVE_CDC_LEADER": return &MoveCdcLeaderReq{}, &MoveCdcLeaderResp{}, nil case k == "CLEAR_CDC_INFO": @@ -6059,23 +6059,23 @@ func (v *EraseDecommissionedBlockResp) Unpack(r io.Reader) error { return nil } -func (v *AllBlockServicesReq) ShuckleRequestKind() ShuckleMessageKind { - return ALL_BLOCK_SERVICES +func (v *AllBlockServicesDeprecatedReq) ShuckleRequestKind() ShuckleMessageKind { + return ALL_BLOCK_SERVICES_DEPRECATED } -func (v *AllBlockServicesReq) Pack(w io.Writer) error { +func (v *AllBlockServicesDeprecatedReq) Pack(w io.Writer) error { return nil } -func (v *AllBlockServicesReq) Unpack(r io.Reader) error { +func (v *AllBlockServicesDeprecatedReq) Unpack(r io.Reader) error { return nil } -func (v *AllBlockServicesResp) ShuckleResponseKind() ShuckleMessageKind { - return ALL_BLOCK_SERVICES +func (v *AllBlockServicesDeprecatedResp) ShuckleResponseKind() ShuckleMessageKind { + return ALL_BLOCK_SERVICES_DEPRECATED } -func (v *AllBlockServicesResp) Pack(w io.Writer) error { +func (v *AllBlockServicesDeprecatedResp) Pack(w io.Writer) error { len1 := len(v.BlockServices) if err := bincode.PackLength(w, len1); err != nil { return err @@ -6088,7 +6088,7 @@ func (v *AllBlockServicesResp) Pack(w io.Writer) error { return nil } -func (v *AllBlockServicesResp) Unpack(r io.Reader) error { +func (v *AllBlockServicesDeprecatedResp) Unpack(r io.Reader) error { var len1 int if err := bincode.UnpackLength(r, &len1); err != nil { return err