Commit 4264de9
authored
feat: chunkserver side chunk lock (#743)
The current implementation of the chunk locking in the system relies
only in the client responses when finishing write and truncate
operations. This commit targets including also chunkserver side replies
after receiving an actual stream of write operations to decide whether
the chunk is locked or not. This is not useful in the current state of
code and must not affect the behavior of the system because the client
responses to the master in order to unlock the chunk happen after the
data is already in the chunkserver or there is some error.
The idea of the change is to keep track in each of the chunk parts of
whether it is expected to be written at the time. Please note this
affects all the writes coming from the client and some truncates. Those
cases trigger one these functions:
- chunk_create_operation
- chunk_increase_version_operation
- chunk_lock_operation
- chunk_duplicate_operation
which can be traced back to the chunk_multi_modify function. After
checking some conditions (specially if the CS version supports this
feature) the new packets arrive to the CS and in most of the cases the
write operation needs to wait for its responses, and the chunk parts
are considered being written.
In the CS side, the locking is handled by the master's main JobPool. It
can start, enforce, end and erase chunk lock jobs. The locked chunks
are special the way that after ending the write operations on it, the
master receives the status of the write operations that was not told to
the clients, so far it is always OK because everything is told to the
clients. Master jobs on enforced locked chunks will have to wait until
the chunk is released, i.e finish writing.
Back again in the master side, it handles disconnection of parts being
written and errors on those writes the same way: increasing version
when the chance appears.
Side changes:
- refactor chunk_multi_modify and chunk_multi_truncate functions.
- change the effective grace time when starting and trying to create
chunk before responding "no space" from 600s to 60s.
- add documentation to some members of the Chunk class deeply involved
in the change.
- remove `usedummylockid` from `chunk_multi_modify` and `writeChunk`
functions.
- in the client side, always talk to the chunkservers when writing.
- the main SaunaFS package version was updated to 5.8.0.
- the cases that return SAUNAFS_ERROR_NOSPACE in the master side
were improved.
The new behavior implemented previously can be now enabled and disabled
via the option USE_CHUNKSERVER_SIDE_CHUNK_LOCK. This option is
reloadable. The decision making instant is at the moment of sending the
specific packet type to the chunkservers.
The testing framework was modified in order to enable this option in
all tests, while the default master behavior has it disabled.
Merge pull request #743 from leil-io/feat-cs-size-chunk-lock
Signed-off-by: Dave <dave@leil.io>File tree
33 files changed
+1499
-321
lines changed- doc
- src
- admin
- chunkserver
- common
- data
- master
- mount
- protocol
- tests
- test_suites/ShortSystemTests
- tools
33 files changed
+1499
-321
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
77 | | - | |
| 77 | + | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
290 | 290 | | |
291 | 291 | | |
292 | 292 | | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
293 | 297 | | |
294 | 298 | | |
295 | 299 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
128 | 128 | | |
129 | 129 | | |
130 | 130 | | |
| 131 | + | |
131 | 132 | | |
132 | 133 | | |
133 | 134 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
| |||
100 | 101 | | |
101 | 102 | | |
102 | 103 | | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
103 | 129 | | |
104 | 130 | | |
105 | 131 | | |
106 | 132 | | |
107 | | - | |
108 | | - | |
| 133 | + | |
| 134 | + | |
109 | 135 | | |
110 | 136 | | |
111 | 137 | | |
| |||
127 | 153 | | |
128 | 154 | | |
129 | 155 | | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
130 | 179 | | |
131 | 180 | | |
132 | 181 | | |
| |||
531 | 580 | | |
532 | 581 | | |
533 | 582 | | |
534 | | - | |
535 | | - | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
536 | 586 | | |
537 | 587 | | |
538 | 588 | | |
| |||
551 | 601 | | |
552 | 602 | | |
553 | 603 | | |
554 | | - | |
555 | | - | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
556 | 607 | | |
557 | 608 | | |
558 | 609 | | |
| |||
564 | 615 | | |
565 | 616 | | |
566 | 617 | | |
567 | | - | |
568 | | - | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
569 | 621 | | |
570 | 622 | | |
571 | 623 | | |
| |||
579 | 631 | | |
580 | 632 | | |
581 | 633 | | |
582 | | - | |
583 | | - | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
584 | 637 | | |
585 | 638 | | |
586 | 639 | | |
| |||
594 | 647 | | |
595 | 648 | | |
596 | 649 | | |
597 | | - | |
598 | | - | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
599 | 653 | | |
600 | 654 | | |
601 | 655 | | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
| 708 | + | |
| 709 | + | |
| 710 | + | |
| 711 | + | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
| 715 | + | |
| 716 | + | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
| 728 | + | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
25 | 26 | | |
26 | 27 | | |
27 | 28 | | |
| |||
87 | 88 | | |
88 | 89 | | |
89 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
90 | 96 | | |
91 | 97 | | |
92 | 98 | | |
| |||
112 | 118 | | |
113 | 119 | | |
114 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
115 | 142 | | |
116 | 143 | | |
117 | 144 | | |
| |||
155 | 182 | | |
156 | 183 | | |
157 | 184 | | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
158 | 240 | | |
159 | 241 | | |
160 | 242 | | |
| |||
196 | 278 | | |
197 | 279 | | |
198 | 280 | | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
199 | 301 | | |
200 | 302 | | |
201 | 303 | | |
| |||
0 commit comments