-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Unify RESP error serialization (#252)
* Add WriteGenericError methods to RespWriteUtils * Swap direct inline errors string writes to WriteGenericError * Prefix all generic error CmdStrings to make them distinguishable from other errors * wip: begin moving CmdStrings to GenericErrorWrite * Edit custom command registration logic to allow using the new generic error logic * Rename the formatting string to similar convention as the static generic errors * Fix tests to handle new error formatting * Prefix all generic error CmdStrings in cluster project * wip: Begin migrating cluster errors to WriteGenericError * Some refactoring done in ProcessSlotManage to be able discern failure modes * Also potential unused "errorMessage" in TryResetSlotsState? * Make SETSLOT use generic error serialization * Make SET-CONFIG-EPOCH use generic error serialization * Make FORGET use generic error serialization * Make REPLICATE use generic error serialization * Make aofsync use generic error serialization * Make ADDSLOTS and ADDSLOTSRANGE use generic error serialization * Make DELSLOTS and DELSLOTSRANGE use generic error serialization * Make DELKEYSINSLOTRANGE use generic error serialization * Also flattened control flow where else block is unnecessary * Restore behavior in SETSLOTSRANGE which was affected by TryParseSlots changes * Make REPLICAOF use generic error serialization * Make MIGRATE use generic error serialization * Make FAILOVER use generic error serialization * Make FAILOVER use generic error serialization * Well, the ProcessFailoverCommands method * Make HISTOGRAM use generic error serialization * Now moving back over to Garnet.Server * Make RESET use generic error serialization * Make HashObjectImpl use generic error serialization * Missed one -ERR prefix in RESET * Make SortedSetObjectImpl use generic error serialization * Move many trivial ones in Garnet.server * Regexing these, no complex control flow to worry about. * dotnet-format * Adjust tests a bit * Flip some assert.equals ordering to give correct expect & actual pairs * Couple collection experssions, couldn't help myself. * Restore some error equals assert to original behavior * Fix one error PRIMARY-ERR format * Restore behavior in ClusterCommand around slot parsing * Make HandleCommandParsingErrors use generic error serialization * This is used by TryMIGRATE * Move more WriteDirect to WriteGenericError * dotnet-format * Abort the plan. Remove WriteGenericError. * And switch over to WriteError * Adjust tests for the WriteError * And few simplifications I came across * Migrate libs/cluster to WriteError * Migrate libs/server to WriteError * Missed couple in cluster * I'm blind * Remove negative-sign from logged errors * Refactor cluster slot commands to use return values instead of errorMessages * Address PR feedback * TryResetSlot(s)State -> ResetSlot(s)State --------- Co-authored-by: Badrish Chandramouli <badrishc@microsoft.com> Co-authored-by: vazois <vazois@microsoft.com>
- Loading branch information
1 parent
763c517
commit 765e614
Showing
54 changed files
with
875 additions
and
690 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.