Commit be2c13e
authored
Set the maximum number of load retries and retry time (#22633)
### **User description**
## What type of PR is this?
- [ ] API-change
- [x] BUG
- [x] Improvement
- [ ] Documentation
- [ ] Feature
- [ ] Test and CI
- [ ] Code Refactoring
## Which issue(s) this PR fixes:
issue matrixorigin/MO-Cloud#6448
## What this PR does / why we need it:
Set the maximum number of load retries and retry time
___
### **PR Type**
Bug fix, Enhancement
___
### **Description**
- Added retry mechanism with max 100 retries and 3-minute timeout for
load operations
- Enhanced logging for long-running read/write operations (>1 minute)
- Improved error handling to track consecutive failures and prevent
infinite loops
- Refactored timing measurements to capture read/write durations more
accurately
___
### Diagram Walkthrough
```mermaid
flowchart LR
A["Read packet"] --> B["Check read time"]
B --> C["Write to pipe"]
C --> D["Check write time"]
D --> E{"Error occurred?"}
E -- "Yes" --> F["Increment error counter"]
F --> G{"Max retries or timeout?"}
G -- "Yes" --> H["Return error"]
G -- "No" --> A
E -- "No" --> I["Reset error counter"]
I --> A
```
<details> <summary><h3> File Walkthrough</h3></summary>
<table><thead><tr><th></th><th align="left">Relevant
files</th></tr></thead><tbody><tr><td><strong>Bug
fix</strong></td><td><table>
<tr>
<td>
<details>
<summary><strong>mysql_cmd_executor.go</strong><dd><code>Add retry
limits and enhanced error handling for load
operations</code></dd></summary>
<hr>
pkg/frontend/mysql_cmd_executor.go
<ul><li>Added retry mechanism with maximum 100 consecutive errors and
3-minute <br>timeout<br> <li> Enhanced logging for read/write operations
exceeding 1 minute duration<br> <li> Improved error tracking with
<code>retError</code> variable to preserve first error<br> <li>
Refactored timing measurements for more accurate read/write duration
<br>capture</ul>
</details>
</td>
<td><a
href="https://github.com/matrixorigin/matrixone/pull/22633/files#diff-af2611d5fc89704398fe09d09644efa41fec8931b395eda292f2f474f1216275">+43/-14</a>
</td>
</tr>
</table></td></tr></tr></tbody></table>
</details>
___1 parent 48f076d commit be2c13e
1 file changed
+43
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2378 | 2378 | | |
2379 | 2379 | | |
2380 | 2380 | | |
2381 | | - | |
| 2381 | + | |
2382 | 2382 | | |
2383 | 2383 | | |
2384 | 2384 | | |
2385 | 2385 | | |
2386 | 2386 | | |
2387 | 2387 | | |
| 2388 | + | |
| 2389 | + | |
| 2390 | + | |
| 2391 | + | |
2388 | 2392 | | |
2389 | 2393 | | |
2390 | 2394 | | |
| |||
2394 | 2398 | | |
2395 | 2399 | | |
2396 | 2400 | | |
2397 | | - | |
2398 | 2401 | | |
2399 | 2402 | | |
2400 | | - | |
2401 | | - | |
| 2403 | + | |
| 2404 | + | |
2402 | 2405 | | |
2403 | 2406 | | |
2404 | | - | |
| 2407 | + | |
2405 | 2408 | | |
2406 | 2409 | | |
2407 | 2410 | | |
2408 | 2411 | | |
2409 | 2412 | | |
2410 | 2413 | | |
2411 | | - | |
| 2414 | + | |
2412 | 2415 | | |
2413 | 2416 | | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
2414 | 2421 | | |
2415 | 2422 | | |
2416 | 2423 | | |
| |||
2419 | 2426 | | |
2420 | 2427 | | |
2421 | 2428 | | |
2422 | | - | |
2423 | 2429 | | |
2424 | 2430 | | |
2425 | 2431 | | |
| |||
2443 | 2449 | | |
2444 | 2450 | | |
2445 | 2451 | | |
2446 | | - | |
| 2452 | + | |
2447 | 2453 | | |
2448 | 2454 | | |
2449 | 2455 | | |
2450 | 2456 | | |
2451 | 2457 | | |
2452 | 2458 | | |
2453 | | - | |
| 2459 | + | |
2454 | 2460 | | |
2455 | 2461 | | |
2456 | 2462 | | |
2457 | 2463 | | |
2458 | 2464 | | |
2459 | | - | |
| 2465 | + | |
2460 | 2466 | | |
2461 | 2467 | | |
2462 | 2468 | | |
2463 | 2469 | | |
2464 | 2470 | | |
2465 | 2471 | | |
| 2472 | + | |
2466 | 2473 | | |
2467 | | - | |
| 2474 | + | |
2468 | 2475 | | |
2469 | | - | |
| 2476 | + | |
2470 | 2477 | | |
2471 | 2478 | | |
2472 | 2479 | | |
2473 | 2480 | | |
| 2481 | + | |
2474 | 2482 | | |
2475 | 2483 | | |
2476 | 2484 | | |
| |||
2486 | 2494 | | |
2487 | 2495 | | |
2488 | 2496 | | |
| 2497 | + | |
| 2498 | + | |
| 2499 | + | |
| 2500 | + | |
| 2501 | + | |
2489 | 2502 | | |
2490 | | - | |
| 2503 | + | |
2491 | 2504 | | |
2492 | 2505 | | |
| 2506 | + | |
| 2507 | + | |
| 2508 | + | |
| 2509 | + | |
2493 | 2510 | | |
2494 | 2511 | | |
2495 | 2512 | | |
| 2513 | + | |
| 2514 | + | |
| 2515 | + | |
| 2516 | + | |
| 2517 | + | |
| 2518 | + | |
| 2519 | + | |
| 2520 | + | |
| 2521 | + | |
| 2522 | + | |
| 2523 | + | |
| 2524 | + | |
2496 | 2525 | | |
2497 | 2526 | | |
2498 | 2527 | | |
| |||
2509 | 2538 | | |
2510 | 2539 | | |
2511 | 2540 | | |
2512 | | - | |
| 2541 | + | |
2513 | 2542 | | |
2514 | 2543 | | |
2515 | 2544 | | |
| |||
0 commit comments