Mooncake/scripts
JinYan Su bde2fcaa13
refactor: introduce expected pattern for error handling in master service (#562)
* refactor: introduce expected pattern for error handling in master service

- Replace ErrorCode return types with tl::expected<T, ErrorCode> pattern
- Improve error handling clarity by separating success values from error codes
- Update MasterService methods to return expected<void, ErrorCode> or expected<T, ErrorCode>
- Modify RPC service interfaces to support expected pattern
- Update all related tests to handle new expected return types
- Add necessary includes for ylt/util/expected.hpp

This change makes error handling more explicit and type-safe:
- Success cases can be accessed via .value()
- Error cases can be accessed via .error()
- Eliminates ambiguity between success and error states

Future work:
- Extend expected pattern to RPC response types
- Enhance error code system for more comprehensive error handling

* Refactor error handling to use expected<T,E> pattern instead of ErrorCode

- Updated MasterService methods to replace ylt::expected with tl::expected for better error handling.
- Modified BatchGetReplicaList, BatchPutStart, BatchPutEnd, and other methods to return tl::expected types.
- Enhanced ClientIntegrationTest to handle expected results from Put, Get, Remove, and other operations using tl::expected.
- Adjusted error handling in clientctl and master_metrics_test to utilize the new expected type.
- Improved overall error reporting in tests to provide clearer feedback on operation failures.

* fix test compile

* refactor: update client implementation and remove master.proto

- Enhanced client.h and client.cpp with new functionality
- Removed obsolete master.proto file
- Updated master_client.cpp and transfer_task.cpp
- Improved integration and stress tests

* fix: update Python integration to work with new batch API

- Replace BatchObjectInfo with vector<vector<Replica::Descriptor>>
- Update BatchPut to handle new return type vector<tl::expected<void, ErrorCode>>
- Fix BatchQuery API usage to work with new expected pattern
- Convert unordered_map to vector format for BatchPut parameter compatibility

* refine master log and metric

* fix(ci): should alloc first

* merge main

* fix tests
2025-07-03 14:54:06 +08:00
..
ascend [TransferEngine] Enable Huawei Ascend Transport for TransferEngine (#502) 2025-07-01 15:47:34 +08:00
build_wheel.sh [Build] Optimize store build control for wheel and local build (#531) 2025-06-20 15:46:35 +08:00
run_tests.sh refactor: introduce expected pattern for error handling in master service (#562) 2025-07-03 14:54:06 +08:00
test_installation.sh [Build] add TE bench into wheel package (#514) 2025-06-18 19:04:09 +08:00