Skip to content

Commit 1644aff

Browse files
committed
update docs
1 parent 71793ea commit 1644aff

File tree

4 files changed

+52
-2
lines changed

4 files changed

+52
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
- Reduce CRD size from `1.4MB` to `96KB` by accepting arbitrary YAML input instead of the underlying schema for the following fields ([#548]):
88
- `podOverrides`
99
- `affinity`
10+
- Optionally move regions to other pods before shutting down a region server ([#570]).
1011

1112
### Fixed
1213

@@ -21,6 +22,7 @@
2122
[#550]: https://github.com/stackabletech/hbase-operator/pull/550
2223
[#556]: https://github.com/stackabletech/hbase-operator/pull/556
2324
[#558]: https://github.com/stackabletech/hbase-operator/pull/558
25+
[#570]: https://github.com/stackabletech/hbase-operator/pull/570
2426

2527
## [24.7.0] - 2024-07-24
2628

deploy/helm/hbase-operator/crds/crds.yaml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,20 +725,25 @@ spec:
725725
type: boolean
726726
type: object
727727
regionMover:
728+
description: Before terminating a region server pod, the RegionMover tool can be invoked to transfer local regions to other servers. This may cause a lot of network traffic in the Kubernetes cluster if the entire HBase stacklet is being restarted. The operator will compute a timeout period for the region move that will not exceed the graceful shutdown timeout.
728729
nullable: true
729730
properties:
730731
ack:
732+
description: If enabled (default), the region mover will confirm that regions are available on the source as well as the target pods before and after the move.
731733
type: boolean
732734
extraOpts:
733735
default: []
736+
description: Additional options to pass to the region mover.
734737
items:
735738
type: string
736739
type: array
737740
maxThreads:
741+
description: Maximum number of threads to use for moving regions.
738742
format: uint16
739743
minimum: 0.0
740744
type: integer
741745
runBeforeShutdown:
746+
description: Move local regions to other servers before terminating a region server's pod.
742747
type: boolean
743748
required:
744749
- ack
@@ -969,20 +974,25 @@ spec:
969974
type: boolean
970975
type: object
971976
regionMover:
977+
description: Before terminating a region server pod, the RegionMover tool can be invoked to transfer local regions to other servers. This may cause a lot of network traffic in the Kubernetes cluster if the entire HBase stacklet is being restarted. The operator will compute a timeout period for the region move that will not exceed the graceful shutdown timeout.
972978
nullable: true
973979
properties:
974980
ack:
981+
description: If enabled (default), the region mover will confirm that regions are available on the source as well as the target pods before and after the move.
975982
type: boolean
976983
extraOpts:
977984
default: []
985+
description: Additional options to pass to the region mover.
978986
items:
979987
type: string
980988
type: array
981989
maxThreads:
990+
description: Maximum number of threads to use for moving regions.
982991
format: uint16
983992
minimum: 0.0
984993
type: integer
985994
runBeforeShutdown:
995+
description: Move local regions to other servers before terminating a region server's pod.
986996
type: boolean
987997
required:
988998
- ack

docs/modules/hbase/pages/usage-guide/operations/graceful-shutdown.adoc

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
= Graceful shutdown
22

3-
You can configure the graceful shutdown as described in xref:concepts:operations/graceful_shutdown.adoc[].
3+
You can configure the graceful shutdown grace period as described in xref:concepts:operations/graceful_shutdown.adoc[].
44

55
== Masters
66

@@ -15,7 +15,7 @@ However, there is no message in the log acknowledging the graceful shutdown.
1515

1616
== RegionServers
1717

18-
As a default, RegionServers have `60 minutes` to shut down gracefully.
18+
By default, RegionServers have `60 minutes` to shut down gracefully.
1919

2020
They use the same mechanism described above.
2121
In contrast to the Master servers, they will, however, acknowledge the graceful shutdown with a message in the logs:
@@ -26,6 +26,30 @@ In contrast to the Master servers, they will, however, acknowledge the graceful
2626
2023-10-11 12:38:05,060 INFO [shutdown-hook-0] regionserver.HRegionServer: ***** STOPPING region server 'test-hbase-regionserver-default-0.test-hbase-regionserver-default.kuttl-test-topical-parakeet.svc.cluster.local,16020,1697027870348' *****
2727
----
2828

29+
The operator allows for finer control over the shutdown process of region servers.
30+
For each region server pod, the region mover tool may be invoked before terminating the region server's pod.
31+
The affected regions are transfered to other pods thus ensuring that the data is not lost.
32+
33+
Here is a an example:
34+
35+
[source,yaml]
36+
----
37+
spec:
38+
regionServers:
39+
config:
40+
regionMover
41+
runBeforeShutdown: true, <1>
42+
maxThreads: 5, <2>
43+
ack: false, <3>
44+
extraOpts: ["--designatedFile", "/path/to/designatedFile"] <4>
45+
----
46+
<1>: Run the region mover tool before shutting down the region server. Default is `false`.
47+
<2>: Maximum number of threads to use for moving regions. Default is 1.
48+
<3>: Enable or disable region confirmation on the present and target servers. Default is `true`.
49+
<4>: Extra options to pass to the region mover tool.
50+
51+
NOTE: There is no need to explicitely specify a timeout for the region movement. The operator will compute an appropriate timeout that cannot exceed the `gracefulShutdownTimeout` for region servers.
52+
2953
== RestServers
3054

3155
As a default, RestServers have `5 minutes` to shut down gracefully.

rust/crd/src/lib.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -518,9 +518,17 @@ impl Configuration for HbaseConfigFragment {
518518
#[derive(Clone, Debug, JsonSchema, PartialEq, Serialize, Deserialize)]
519519
#[serde(rename_all = "camelCase")]
520520
pub struct RegionMover {
521+
/// Move local regions to other servers before terminating a region server's pod.
521522
run_before_shutdown: bool,
523+
524+
/// Maximum number of threads to use for moving regions.
522525
max_threads: u16,
526+
527+
/// If enabled (default), the region mover will confirm that regions are available on the
528+
/// source as well as the target pods before and after the move.
523529
ack: bool,
530+
531+
/// Additional options to pass to the region mover.
524532
#[serde(default)]
525533
extra_opts: Vec<String>,
526534
}
@@ -575,6 +583,12 @@ pub struct RegionServerConfig {
575583
/// Time period Pods have to gracefully shut down, e.g. `30m`, `1h` or `2d`. Consult the operator documentation for details.
576584
#[fragment_attrs(serde(default))]
577585
pub graceful_shutdown_timeout: Option<Duration>,
586+
587+
/// Before terminating a region server pod, the RegionMover tool can be invoked to transfer
588+
/// local regions to other servers.
589+
/// This may cause a lot of network traffic in the Kubernetes cluster if the entire HBase stacklet is being
590+
/// restarted.
591+
/// The operator will compute a timeout period for the region move that will not exceed the graceful shutdown timeout.
578592
pub region_mover: RegionMover,
579593
}
580594

0 commit comments

Comments
 (0)