Skip to content

Commit 31ceb49

Browse files
author
SqlRush
committed
fix(cluster): clang-format spec-5.16 sources for fast-gate Validate
Session-1 5.16 sources (cluster_debug.c, cluster_gcs_block.{c,h}, cluster_guc.c, cluster_grd.h, test_cluster_grd.c) carried clang-format v18 violations that were never CI-checked while connectivity was down. No functional change.
1 parent 4d7b1fe commit 31ceb49

6 files changed

Lines changed: 24 additions & 27 deletions

File tree

src/backend/cluster/cluster_debug.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1128,8 +1128,7 @@ dump_grd_recovery(ReturnSetInfo *rsinfo)
11281128
* category; no new dump category, §8 Q6-A). */
11291129
emit_row(rsinfo, "grd_recovery", "join_remaster_started",
11301130
fmt_int64((int64)c.join_remaster_started));
1131-
emit_row(rsinfo, "grd_recovery", "join_remaster_done",
1132-
fmt_int64((int64)c.join_remaster_done));
1131+
emit_row(rsinfo, "grd_recovery", "join_remaster_done", fmt_int64((int64)c.join_remaster_done));
11331132
emit_row(rsinfo, "grd_recovery", "join_shards_remastered",
11341133
fmt_int64((int64)c.join_shards_remastered));
11351134
emit_row(rsinfo, "grd_recovery", "join_block_views_rebuilt",

src/backend/cluster/cluster_gcs_block.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@
4949
#include "cluster/cluster_gcs_block_dedup.h" /* spec-2.34 D1 — counter forward */
5050
#include "cluster/cluster_grd.h" /* spec-4.6 D4 — block_path_failclosed counter */
5151
#include "cluster/cluster_grd_outbound.h"
52-
#include "cluster/cluster_membership.h" /* spec-5.16 D3b — is_member master-side gate */
53-
#include "cluster/cluster_qvotec.h" /* spec-5.16 D3b — in_quorum master-side gate */
52+
#include "cluster/cluster_membership.h" /* spec-5.16 D3b — is_member master-side gate */
53+
#include "cluster/cluster_qvotec.h" /* spec-5.16 D3b — in_quorum master-side gate */
5454
#include "cluster/cluster_recovery_merge.h" /* spec-4.7 D5 — recovered_through redo gate */
5555
#include "cluster/cluster_guc.h"
5656
#include "cluster/cluster_inject.h"
@@ -676,8 +676,7 @@ cluster_gcs_block_phase_for_tag(BufferTag tag)
676676
* the optimization; the master-side hard gate (cluster_gcs_handle_block_
677677
* request_envelope) is the correctness backstop for stale-view requesters.
678678
*/
679-
if (cluster_grd_join_remaster_active_for_shard(tag)
680-
&& !cluster_grd_block_view_rebuilt(tag)) {
679+
if (cluster_grd_join_remaster_active_for_shard(tag) && !cluster_grd_block_view_rebuilt(tag)) {
681680
cluster_grd_inc_join_block_failclosed();
682681
return GCS_BLOCK_RECOVERING;
683682
}

src/backend/cluster/cluster_guc.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2237,16 +2237,16 @@ cluster_init_guc(void)
22372237
* PCM block snap-back fence is NOT gated here (it is forced correctness
22382238
* bound to cluster.online_join, INV-R13); this only controls whether the
22392239
* joiner's home-shard GES mastership is moved back from the survivor. */
2240-
DefineCustomBoolVariable("cluster.join_remaster_enabled",
2241-
gettext_noop("On node rejoin, move the joiner's home-shard GES "
2242-
"mastership back from the survivor (optional rebalance)."),
2243-
gettext_noop("Default off: the joiner's logical-lock mastership stays "
2244-
"on the survivor that held it during the absence (load "
2245-
"imbalance only). The PCM block view rebuild + RECOVERING "
2246-
"fence always run when cluster.online_join is on, "
2247-
"independent of this GUC (forced correctness)."),
2248-
&cluster_join_remaster_enabled, false, PGC_POSTMASTER, 0, NULL, NULL,
2249-
NULL);
2240+
DefineCustomBoolVariable(
2241+
"cluster.join_remaster_enabled",
2242+
gettext_noop("On node rejoin, move the joiner's home-shard GES "
2243+
"mastership back from the survivor (optional rebalance)."),
2244+
gettext_noop("Default off: the joiner's logical-lock mastership stays "
2245+
"on the survivor that held it during the absence (load "
2246+
"imbalance only). The PCM block view rebuild + RECOVERING "
2247+
"fence always run when cluster.online_join is on, "
2248+
"independent of this GUC (forced correctness)."),
2249+
&cluster_join_remaster_enabled, false, PGC_POSTMASTER, 0, NULL, NULL, NULL);
22502250

22512251
DefineCustomIntVariable("cluster.join_convergence_timeout_ms",
22522252
gettext_noop("Deadline for an online join to converge + commit."),

src/include/cluster/cluster_gcs_block.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,8 @@ typedef enum GcsBlockReplyStatus {
171171
* 8.A: a cached copy with no
172172
* invalidation path would go stale).
173173
* Reuses HC103 copy-ship + HC127
174-
* watermark. */,
174+
* watermark. */
175+
,
175176
GCS_BLOCK_REPLY_DENIED_RESOURCE_RECOVERING = 14 /* PGRAC: spec-5.16 D3b NEW;
176177
* master-side hard gate (INV-R8/R14)
177178
* — the master (a rejoining node) is

src/include/cluster/cluster_grd.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -365,11 +365,11 @@ typedef struct ClusterGrdShared {
365365
/* spec-5.16 D5 — join-direction remaster counters (dump_grd grd_recovery
366366
* segment; kept distinct from the failure-driven remaster_* counters so
367367
* ops can tell the two remaster kinds apart — §8 Q6-A). */
368-
pg_atomic_uint64 join_remaster_started_count; /* JOIN episode entered */
369-
pg_atomic_uint64 join_remaster_done_count; /* JOIN episode reached IDLE */
370-
pg_atomic_uint64 join_shards_remastered_count; /* GRD shards moved to joiner */
371-
pg_atomic_uint64 join_block_views_rebuilt_count; /* joiner-home fences lifted */
372-
pg_atomic_uint64 join_block_recovering_failclosed_count; /* 53R9L denied (both gates) */
368+
pg_atomic_uint64 join_remaster_started_count; /* JOIN episode entered */
369+
pg_atomic_uint64 join_remaster_done_count; /* JOIN episode reached IDLE */
370+
pg_atomic_uint64 join_shards_remastered_count; /* GRD shards moved to joiner */
371+
pg_atomic_uint64 join_block_views_rebuilt_count; /* joiner-home fences lifted */
372+
pg_atomic_uint64 join_block_recovering_failclosed_count; /* 53R9L denied (both gates) */
373373
} ClusterGrdShared;
374374

375375
/* spec-2.17 D28b — extern atomic generation alloc helper(InitProcess hook). */

src/test/cluster_unit/test_cluster_grd.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3288,7 +3288,7 @@ ut_jr_setup_3node(void)
32883288
int32 nodes3[] = { 0, 1, 2 };
32893289

32903290
ut_mock_epoch = 0;
3291-
ut_member_mask = -1; /* all members */
3291+
ut_member_mask = -1; /* all members */
32923292
ut_mock_static_master = 0;
32933293
ut_reset_grd_shmem(); /* clean fence / recovery_done_epoch / direction */
32943294
cluster_grd_shmem_init();
@@ -3559,15 +3559,13 @@ UT_TEST(test_jr_u15_master_side_gate_decision)
35593559
ut_mock_static_master = 1;
35603560

35613561
/* The gate's home-block leg: active_for_shard && !view_rebuilt. */
3562-
deny = cluster_grd_join_remaster_active_for_shard(tag)
3563-
&& !cluster_grd_block_view_rebuilt(tag);
3562+
deny = cluster_grd_join_remaster_active_for_shard(tag) && !cluster_grd_block_view_rebuilt(tag);
35643563
UT_ASSERT(deny);
35653564

35663565
cluster_grd_recovery_mark_peer_done(0, 10);
35673566
cluster_grd_recovery_mark_peer_done(1, 10);
35683567
cluster_grd_recovery_mark_peer_done(2, 10);
3569-
deny = cluster_grd_join_remaster_active_for_shard(tag)
3570-
&& !cluster_grd_block_view_rebuilt(tag);
3568+
deny = cluster_grd_join_remaster_active_for_shard(tag) && !cluster_grd_block_view_rebuilt(tag);
35713569
UT_ASSERT(!deny);
35723570
}
35733571

0 commit comments

Comments
 (0)