Commit 10254e6
authored
return block data when deleting it (#175)
### TL;DR
Enhanced `DeleteBlockData` to return deleted block data, enabling better handling of reorgs.
### What changed?
Modified the `DeleteBlockData` method in the storage interface to return the deleted block data:
- Updated the method signature in `IMainStorage` interface to return `([]common.BlockData, error)`
- Implemented the new functionality in `ClickHouseConnector` to collect and return deleted data
- Modified the individual delete methods (`deleteBlocks`, `deleteLogs`, etc.) to return the deleted entities
- Updated the `MemoryConnector` implementation to match the new interface
- Fixed the mock implementation to support the new signature
- Updated the caller in `ReorgHandler` to handle the new return value
### How to test?
1. Run unit tests to verify the updated interface implementations
2. Test a reorg scenario to ensure deleted block data is properly returned
3. Verify that the reorg handler correctly processes the returned data
### Why make this change?
This change improves the reorg handling process by providing access to the deleted block data, which can be useful for:
- Auditing what was removed during a reorg
- Potentially using the deleted data for other purposes
- Making the reorg process more transparent and traceable
- Setting the foundation for making delete and insert operations atomicFile tree
6 files changed
+97
-39
lines changed- internal
- orchestrator
- storage
- test/mocks
6 files changed
+97
-39
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
| 281 | + | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
504 | 504 | | |
505 | 505 | | |
506 | 506 | | |
507 | | - | |
| 507 | + | |
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
| |||
613 | 613 | | |
614 | 614 | | |
615 | 615 | | |
616 | | - | |
| 616 | + | |
617 | 617 | | |
618 | 618 | | |
619 | 619 | | |
| |||
681 | 681 | | |
682 | 682 | | |
683 | 683 | | |
684 | | - | |
| 684 | + | |
685 | 685 | | |
686 | 686 | | |
687 | 687 | | |
| |||
745 | 745 | | |
746 | 746 | | |
747 | 747 | | |
748 | | - | |
| 748 | + | |
749 | 749 | | |
750 | 750 | | |
751 | 751 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
987 | 987 | | |
988 | 988 | | |
989 | 989 | | |
990 | | - | |
| 990 | + | |
991 | 991 | | |
992 | 992 | | |
993 | 993 | | |
994 | 994 | | |
995 | 995 | | |
| 996 | + | |
| 997 | + | |
996 | 998 | | |
997 | 999 | | |
998 | | - | |
| 1000 | + | |
| 1001 | + | |
999 | 1002 | | |
1000 | 1003 | | |
1001 | 1004 | | |
1002 | 1005 | | |
| 1006 | + | |
| 1007 | + | |
| 1008 | + | |
| 1009 | + | |
| 1010 | + | |
1003 | 1011 | | |
1004 | 1012 | | |
1005 | 1013 | | |
1006 | 1014 | | |
1007 | | - | |
| 1015 | + | |
| 1016 | + | |
1008 | 1017 | | |
1009 | 1018 | | |
1010 | 1019 | | |
1011 | 1020 | | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
| 1025 | + | |
1012 | 1026 | | |
1013 | 1027 | | |
1014 | 1028 | | |
1015 | 1029 | | |
1016 | | - | |
| 1030 | + | |
| 1031 | + | |
1017 | 1032 | | |
1018 | 1033 | | |
1019 | 1034 | | |
1020 | 1035 | | |
| 1036 | + | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
1021 | 1041 | | |
1022 | 1042 | | |
1023 | 1043 | | |
1024 | 1044 | | |
1025 | | - | |
| 1045 | + | |
| 1046 | + | |
1026 | 1047 | | |
1027 | 1048 | | |
1028 | 1049 | | |
1029 | 1050 | | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
1030 | 1056 | | |
1031 | 1057 | | |
1032 | 1058 | | |
1033 | 1059 | | |
1034 | 1060 | | |
1035 | | - | |
| 1061 | + | |
1036 | 1062 | | |
1037 | | - | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
1038 | 1068 | | |
1039 | 1069 | | |
1040 | | - | |
| 1070 | + | |
1041 | 1071 | | |
1042 | 1072 | | |
1043 | 1073 | | |
1044 | 1074 | | |
1045 | 1075 | | |
1046 | 1076 | | |
1047 | | - | |
| 1077 | + | |
1048 | 1078 | | |
1049 | 1079 | | |
1050 | | - | |
| 1080 | + | |
1051 | 1081 | | |
1052 | | - | |
| 1082 | + | |
1053 | 1083 | | |
1054 | 1084 | | |
| 1085 | + | |
| 1086 | + | |
| 1087 | + | |
| 1088 | + | |
1055 | 1089 | | |
1056 | 1090 | | |
1057 | | - | |
| 1091 | + | |
1058 | 1092 | | |
1059 | 1093 | | |
1060 | 1094 | | |
1061 | 1095 | | |
1062 | 1096 | | |
1063 | 1097 | | |
1064 | | - | |
| 1098 | + | |
1065 | 1099 | | |
1066 | 1100 | | |
1067 | | - | |
| 1101 | + | |
1068 | 1102 | | |
1069 | | - | |
| 1103 | + | |
1070 | 1104 | | |
1071 | 1105 | | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
1072 | 1110 | | |
1073 | 1111 | | |
1074 | | - | |
| 1112 | + | |
1075 | 1113 | | |
1076 | 1114 | | |
1077 | 1115 | | |
1078 | 1116 | | |
1079 | 1117 | | |
1080 | 1118 | | |
1081 | | - | |
| 1119 | + | |
1082 | 1120 | | |
1083 | 1121 | | |
1084 | | - | |
| 1122 | + | |
1085 | 1123 | | |
1086 | | - | |
| 1124 | + | |
1087 | 1125 | | |
1088 | 1126 | | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
1089 | 1131 | | |
1090 | 1132 | | |
1091 | | - | |
| 1133 | + | |
1092 | 1134 | | |
1093 | 1135 | | |
1094 | 1136 | | |
1095 | 1137 | | |
1096 | 1138 | | |
1097 | 1139 | | |
1098 | | - | |
| 1140 | + | |
1099 | 1141 | | |
1100 | 1142 | | |
1101 | | - | |
| 1143 | + | |
1102 | 1144 | | |
1103 | | - | |
| 1145 | + | |
1104 | 1146 | | |
1105 | 1147 | | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
1106 | 1152 | | |
1107 | 1153 | | |
1108 | 1154 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
103 | 103 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
438 | | - | |
| 438 | + | |
439 | 439 | | |
440 | 440 | | |
441 | 441 | | |
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
447 | | - | |
| 447 | + | |
448 | 448 | | |
449 | 449 | | |
450 | 450 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments