Commit a12c319
authored
update fatal print with more context (#21607)
### **User description**
## What type of PR is this?
- [ ] API-change
- [ ] BUG
- [ ] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [x] Code Refactoring
## Which issue(s) this PR fixes:
issue #21602
## What this PR does / why we need it:
update fatal print with more context
___
### **PR Type**
Enhancement, Bug fix
___
### **Description**
- Refactored logging to provide more context and consistency:
- Replaced `logutil.Infof` with `logutil.Debugf` or `logutil.Info` for
better log level usage.
- Enhanced error and debug logs with additional context using `zap`
fields.
- Updated fatal logs to include transaction IDs for debugging.
- Removed unused or commented-out code to improve codebase
maintainability.
- Improved function signatures to include additional parameters for
better traceability.
- Enhanced garbage collection and snapshot-related logging for better
traceability.
___
### **Changes walkthrough** 📝
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Enhancement</strong></td><td><details><summary>8
files</summary><table>
<tr>
<td><strong>stats.go</strong><dd><code>Updated logging levels and added
context to debug logs</code> </dd></td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/21607/files#diff-d0f8ce84135a062e5992dcb3d1175993ee396beae48de126969255cd9240d02b">+1/-1</a>
</td>
</tr>
<tr>
<td><strong>txn_table.go</strong><dd><code>Enhanced logging with error
handling and removed unused code</code></dd></td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/21607/files#diff-ec8d7fbb6765aa12484ff5529b88835dc1da369005256b065fb3db4972f2d32f">+19/-79</a>
</td>
</tr>
<tr>
<td><strong>types.go</strong><dd><code>Added transaction ID context to
fatal logs</code>
</dd></td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/21607/files#diff-2d4ca99c63be4d7a3464a5089669767530c849522edfe3030145a5b059775852">+4/-4</a>
</td>
</tr>
<tr>
<td><strong>catalog.go</strong><dd><code>Updated function to include
reason parameter in logging</code> </dd></td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/21607/files#diff-c942af281aef8741f696ca2ae2ccc57aa59dee5520fdfb7a0f4c67a4e70f939c">+1/-1</a>
</td>
</tr>
<tr>
<td><strong>database.go</strong><dd><code>Enhanced logging with reason
parameter for table removal</code> </dd></td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/21607/files#diff-c54ecf2f56733033a88c6ae533ad878909366fd7d5166d12149e23fdec8e5116">+7/-3</a>
</td>
</tr>
<tr>
<td><strong>table.go</strong><dd><code>Updated rollback logging to
include reason for removal</code> </dd></td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/21607/files#diff-e8150a24b9afd22197ca003bbc47e435ee0357a8b96474a0a118a8e8222c7dd7">+1/-1</a>
</td>
</tr>
<tr>
<td><strong>snapshot.go</strong><dd><code>Improved snapshot and garbage
collection logging</code>
</dd></td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/21607/files#diff-111781ff442a07a8deefe4a9fa1e799b2b5da03309f03c042a9b9b83e33a21be">+40/-19</a>
</td>
</tr>
<tr>
<td><strong>table_space.go</strong><dd><code>Enhanced logging for object
creation in table space</code>
</dd></td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/21607/files#diff-eb2583ca6c5dea86857b6c9ba7eff911e281c04e71c85d0dfa46eec9f80f3178">+5/-1</a>
</td>
</tr>
</table></details></td></tr></tr></tbody></table>
___
> <details> <summary> Need help?</summary><li>Type <code>/help how to
...</code> in the comments thread for any questions about Qodo Merge
usage.</li><li>Check out the <a
href="https://qodo-merge-docs.qodo.ai/usage-guide/">documentation</a>
for more information.</li></details>1 parent 8383dc6 commit a12c319
File tree
11 files changed
+162
-166
lines changed- pkg/vm/engine
- disttae
- tae
- catalog
- logtail
- txn/txnimpl
11 files changed
+162
-166
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
441 | 441 | | |
442 | 442 | | |
443 | 443 | | |
444 | | - | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
445 | 451 | | |
446 | 452 | | |
447 | 453 | | |
| |||
524 | 530 | | |
525 | 531 | | |
526 | 532 | | |
527 | | - | |
528 | | - | |
| 533 | + | |
529 | 534 | | |
530 | 535 | | |
531 | 536 | | |
| |||
624 | 629 | | |
625 | 630 | | |
626 | 631 | | |
627 | | - | |
628 | | - | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
629 | 637 | | |
630 | | - | |
631 | 638 | | |
632 | 639 | | |
633 | 640 | | |
| |||
700 | 707 | | |
701 | 708 | | |
702 | 709 | | |
703 | | - | |
704 | | - | |
705 | | - | |
706 | | - | |
707 | | - | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
708 | 718 | | |
709 | 719 | | |
710 | 720 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
945 | 945 | | |
946 | 946 | | |
947 | 947 | | |
948 | | - | |
| 948 | + | |
949 | 949 | | |
950 | 950 | | |
951 | 951 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
192 | 192 | | |
193 | 193 | | |
194 | 194 | | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
202 | 209 | | |
203 | 210 | | |
204 | 211 | | |
205 | 212 | | |
206 | | - | |
207 | | - | |
| 213 | + | |
208 | 214 | | |
209 | 215 | | |
210 | | - | |
211 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
212 | 222 | | |
213 | 223 | | |
214 | 224 | | |
215 | | - | |
216 | | - | |
| 225 | + | |
217 | 226 | | |
218 | 227 | | |
219 | 228 | | |
| |||
266 | 275 | | |
267 | 276 | | |
268 | 277 | | |
269 | | - | |
270 | | - | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
271 | 284 | | |
272 | 285 | | |
273 | 286 | | |
| |||
369 | 382 | | |
370 | 383 | | |
371 | 384 | | |
372 | | - | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
373 | 390 | | |
374 | 391 | | |
375 | 392 | | |
| |||
384 | 401 | | |
385 | 402 | | |
386 | 403 | | |
387 | | - | |
388 | | - | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
389 | 409 | | |
390 | 410 | | |
391 | 411 | | |
| |||
556 | 576 | | |
557 | 577 | | |
558 | 578 | | |
559 | | - | |
560 | | - | |
| 579 | + | |
561 | 580 | | |
562 | 581 | | |
563 | 582 | | |
| |||
583 | 602 | | |
584 | 603 | | |
585 | 604 | | |
586 | | - | |
587 | | - | |
| 605 | + | |
588 | 606 | | |
589 | 607 | | |
590 | 608 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| 20 | + | |
20 | 21 | | |
21 | 22 | | |
22 | 23 | | |
| |||
156 | 157 | | |
157 | 158 | | |
158 | 159 | | |
159 | | - | |
160 | | - | |
161 | | - | |
| 160 | + | |
| 161 | + | |
162 | 162 | | |
163 | 163 | | |
164 | 164 | | |
| |||
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
| 172 | + | |
177 | 173 | | |
178 | 174 | | |
179 | 175 | | |
| |||
305 | 301 | | |
306 | 302 | | |
307 | 303 | | |
308 | | - | |
309 | | - | |
| 304 | + | |
| 305 | + | |
310 | 306 | | |
311 | 307 | | |
312 | 308 | | |
| |||
742 | 738 | | |
743 | 739 | | |
744 | 740 | | |
745 | | - | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
746 | 746 | | |
747 | 747 | | |
748 | 748 | | |
| |||
773 | 773 | | |
774 | 774 | | |
775 | 775 | | |
776 | | - | |
777 | | - | |
778 | | - | |
779 | 776 | | |
780 | 777 | | |
781 | 778 | | |
| |||
1009 | 1006 | | |
1010 | 1007 | | |
1011 | 1008 | | |
1012 | | - | |
1013 | | - | |
1014 | | - | |
1015 | | - | |
| 1009 | + | |
| 1010 | + | |
| 1011 | + | |
| 1012 | + | |
| 1013 | + | |
| 1014 | + | |
| 1015 | + | |
1016 | 1016 | | |
1017 | 1017 | | |
1018 | 1018 | | |
| |||
1040 | 1040 | | |
1041 | 1041 | | |
1042 | 1042 | | |
1043 | | - | |
1044 | | - | |
1045 | | - | |
1046 | | - | |
1047 | | - | |
1048 | | - | |
1049 | | - | |
1050 | | - | |
1051 | | - | |
1052 | | - | |
1053 | | - | |
1054 | | - | |
1055 | | - | |
1056 | | - | |
1057 | | - | |
1058 | | - | |
1059 | | - | |
1060 | | - | |
1061 | | - | |
1062 | | - | |
1063 | | - | |
1064 | | - | |
1065 | | - | |
1066 | | - | |
1067 | | - | |
1068 | | - | |
1069 | | - | |
1070 | | - | |
1071 | | - | |
1072 | | - | |
1073 | | - | |
1074 | | - | |
1075 | | - | |
1076 | | - | |
1077 | | - | |
1078 | | - | |
1079 | | - | |
1080 | | - | |
1081 | | - | |
1082 | | - | |
1083 | | - | |
1084 | | - | |
1085 | | - | |
1086 | | - | |
1087 | | - | |
1088 | | - | |
1089 | | - | |
1090 | | - | |
1091 | | - | |
1092 | | - | |
1093 | | - | |
1094 | | - | |
1095 | | - | |
1096 | | - | |
1097 | | - | |
1098 | | - | |
1099 | | - | |
1100 | | - | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
1105 | 1043 | | |
1106 | 1044 | | |
1107 | 1045 | | |
| |||
1997 | 1935 | | |
1998 | 1936 | | |
1999 | 1937 | | |
2000 | | - | |
2001 | | - | |
2002 | | - | |
2003 | | - | |
2004 | | - | |
2005 | | - | |
| 1938 | + | |
| 1939 | + | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
| 1943 | + | |
2006 | 1944 | | |
2007 | 1945 | | |
2008 | 1946 | | |
| |||
2015 | 1953 | | |
2016 | 1954 | | |
2017 | 1955 | | |
2018 | | - | |
2019 | | - | |
2020 | | - | |
2021 | | - | |
2022 | | - | |
2023 | | - | |
2024 | | - | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
2025 | 1963 | | |
2026 | 1964 | | |
2027 | 1965 | | |
| |||
2278 | 2216 | | |
2279 | 2217 | | |
2280 | 2218 | | |
2281 | | - | |
| 2219 | + | |
| 2220 | + | |
| 2221 | + | |
2282 | 2222 | | |
2283 | 2223 | | |
2284 | 2224 | | |
| |||
0 commit comments