Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
338 commits
Select commit Hold shift + click to select a range
40c2f52
store: ignore stale promotion cursors
bootjp Jul 14, 2026
327cb1c
Merge remote-tracking branch 'origin/design/hotspot-split-m2-cross-gr…
bootjp Jul 14, 2026
f1aeeeb
Guard split fence retry paths
bootjp Jul 14, 2026
1db42a8
Merge remote-tracking branch 'origin/design/hotspot-split-m2-fence-dr…
bootjp Jul 14, 2026
4b1d950
Merge remote-tracking branch 'origin/design/hotspot-split-m2-cross-gr…
bootjp Jul 14, 2026
961a177
Merge remote-tracking branch 'origin/design/hotspot-split-m2-promote'…
bootjp Jul 14, 2026
9d9e051
Fix promotion completion merge compatibility
bootjp Jul 14, 2026
8e74d6e
Merge promotion completion into target readiness
bootjp Jul 14, 2026
2d57ae9
Fail closed read-only shard readiness checks
bootjp Jul 14, 2026
9994ec7
Merge remote-tracking branch 'origin/design/hotspot-split-m2-target-r…
bootjp Jul 14, 2026
8d11161
Guard snapshot spooling disk headroom
bootjp Jul 14, 2026
0215c38
Raise snapshot spool headroom reserve
bootjp Jul 14, 2026
774779b
Fix raft startup and snapshot spool guards
bootjp Jul 14, 2026
46722f6
Handle route fences in adapter retries
bootjp Jul 14, 2026
70cf6f8
Stabilize raft snapshot dispatch and maintenance gates
bootjp Jul 14, 2026
a241809
Honor partition resolver in fence prechecks
bootjp Jul 14, 2026
ee363c4
Make raft startup and fence checks deterministic
bootjp Jul 14, 2026
54ad999
Gate public startup after raft replay
bootjp Jul 14, 2026
e20475f
Stabilize raft dispatch and S3 cleanup fences
bootjp Jul 14, 2026
c3a8ecf
Stabilize raft startup and write fences
bootjp Jul 14, 2026
61feed4
Stabilize route-fence cleanup retries
bootjp Jul 14, 2026
f373cd3
Keep heartbeat responses coalescing under read-index load
bootjp Jul 14, 2026
8f821fe
Stabilize raft snapshot recovery checkpoints
bootjp Jul 14, 2026
3e988ef
Enforce current route fences at apply time
bootjp Jul 14, 2026
04e8053
Prioritize received raft snapshots
bootjp Jul 14, 2026
d818602
Stabilize snapshot catch-up and fence checks
bootjp Jul 14, 2026
db9843a
Stabilize startup reads and snapshot recovery
bootjp Jul 15, 2026
a6d7d76
Reset stale raft peer connections
bootjp Jul 15, 2026
c8f865e
Stabilize snapshot catch-up and fence routing
bootjp Jul 15, 2026
b553090
Keep SQS receive route fences visible
bootjp Jul 15, 2026
d2b22ac
Stabilize redis proxy and raft recovery
bootjp Jul 15, 2026
549a786
Add migration fence drain guards (#1087)
bootjp Jul 15, 2026
fefd809
Fix sparse Lua list pop fallback
bootjp Jul 16, 2026
e1b32b5
Align ElasticKV proxy socket timeouts
bootjp Jul 16, 2026
cf47858
Replay blocking zset pops deterministically
bootjp Jul 16, 2026
f697640
Cap ElasticKV secondary script concurrency
bootjp Jul 16, 2026
7e40979
Refresh ElasticKV leader after not-leader replies
bootjp Jul 16, 2026
3df9239
Avoid full stream rewrites for Lua XADD
bootjp Jul 16, 2026
d19b2a4
Handle Redis proxy replay edge cases
bootjp Jul 16, 2026
a850ee1
distribution: add split job management RPCs (#1092)
bootjp Jul 16, 2026
b8bb6ad
Honor Lua XADD cached state
bootjp Jul 16, 2026
adf5cdb
Cover Lua XADD maxlen zero append
bootjp Jul 16, 2026
01b02ad
Merge remote-tracking branch 'origin/main' into work/pr1088-conflict
bootjp Jul 16, 2026
f02d1c0
Merge remote-tracking branch 'origin/design/hotspot-split-m2-store-ex…
bootjp Jul 16, 2026
7407423
Enforce migration write floors during apply
bootjp Jul 16, 2026
2c920bc
Fence migration exports with applied reads
bootjp Jul 16, 2026
bdf05a6
Delete staged rows for migrated prefixes
bootjp Jul 16, 2026
c9d7ddc
Preserve staged scan visibility
bootjp Jul 16, 2026
bbc1876
migration: harden target readiness guards
bootjp Jul 16, 2026
a02b6c1
migration: add target readiness guard (#1091)
bootjp Jul 16, 2026
acc9305
migration: fix staged s3 bucket routing
bootjp Jul 16, 2026
f902f34
migration: persist promotion timestamp floor
bootjp Jul 16, 2026
e3e37ce
migration: keep invalid promote cursors non-halting
bootjp Jul 16, 2026
f6457de
migration: promote staged versions (#1089)
bootjp Jul 16, 2026
a3b7276
Merge remote-tracking branch 'origin/design/hotspot-split-m2-cross-gr…
bootjp Jul 16, 2026
f51ca32
Merge remote-tracking branch 'origin/design/hotspot-split-m2-promotio…
bootjp Jul 16, 2026
5dec8cb
migration: fix promotion complete review findings
bootjp Jul 16, 2026
00da46c
migration: make promotion completion retry idempotent
bootjp Jul 16, 2026
19961d3
migration: disambiguate legacy list exports
bootjp Jul 16, 2026
bd55701
store: preserve empty-key migration exports
bootjp Jul 16, 2026
8a687ca
migration: tighten routed cleanup safety
bootjp Jul 16, 2026
fd179f9
migration: preserve ambiguous list tombstones
bootjp Jul 16, 2026
c275022
adapter: preserve scan route groups for list cleanup
bootjp Jul 16, 2026
5cf01fd
adapter: backtrack list compactor accepted tails
bootjp Jul 16, 2026
7fe4112
kv: cover pinned primary transaction commits
bootjp Jul 16, 2026
83cd5bf
ci: generate redis proxy image metadata locally
bootjp Jul 16, 2026
0e76181
proxy: allow redis-only without secondary seeds
bootjp Jul 16, 2026
ab82447
ci: avoid failing lint on reviewdog API errors
bootjp Jul 16, 2026
5189172
ci: keep lint required when reviewdog is unavailable
bootjp Jul 16, 2026
319b442
migration: persist applied index on imports
bootjp Jul 16, 2026
2c29191
kv: preserve broad scans with staged routes
bootjp Jul 16, 2026
aaa96da
migration: gate import proposals during rollouts
bootjp Jul 17, 2026
d34d103
kv: reject raw prefix writes below floors
bootjp Jul 17, 2026
78a0400
migration: route partitioned exports by group
bootjp Jul 17, 2026
4851c6f
kv: scan staged routes for physical limits
bootjp Jul 17, 2026
052c64c
Merge cross-group migration fixes
bootjp Jul 17, 2026
2b7c3af
migration: keep split capability gated
bootjp Jul 17, 2026
eea5dec
adapter: pin sparse list fallback route bounds
bootjp Jul 17, 2026
1b70e39
redis: fix Lua XADD and blocking move replay
bootjp Jul 17, 2026
8df8acf
proxy: replay blocking multipop writes
bootjp Jul 17, 2026
9a0286d
proxy: avoid retrying user not-leader errors
bootjp Jul 17, 2026
7b12482
proxy: classify not-leader redis replies safely
bootjp Jul 17, 2026
5d78d7a
migration: reject armed readiness without write floor
bootjp Jul 17, 2026
178fda6
docs: mark hotspot m2 migration partial
bootjp Jul 17, 2026
c065ad9
migration: run split target promotion
bootjp Jul 17, 2026
252bd64
migration: harden split runner promotion
bootjp Jul 17, 2026
938a284
distribution: keep split migration gates closed
bootjp Jul 17, 2026
3e1c85f
Fix sparse Lua list pop fallback (#1094)
bootjp Jul 17, 2026
1c7ea5b
distribution: finish split promotion cleanup
bootjp Jul 17, 2026
07c4eea
Merge hotspot split M2 wire updates
bootjp Jul 18, 2026
3a7c3c2
Fix pinned migration cleanup routing
bootjp Jul 18, 2026
903e589
adapter: preserve stream metadata on Lua expiry
bootjp Jul 18, 2026
b3a3e7e
Merge remote-tracking branch 'origin/design/hotspot-split-m2-wire' in…
bootjp Jul 18, 2026
2c3d7d8
Merge remote-tracking branch 'origin/design/hotspot-split-m2-store-ex…
bootjp Jul 18, 2026
79405da
Merge remote-tracking branch 'origin/design/hotspot-split-m2-store-ex…
bootjp Jul 18, 2026
d9da086
raft: report cold-start replay gaps safely
bootjp Jul 18, 2026
5affdac
Merge remote-tracking branch 'origin/design/hotspot-split-m2-store-ex…
bootjp Jul 18, 2026
34706b0
Merge remote-tracking branch 'origin/design/hotspot-split-m2-cross-gr…
bootjp Jul 18, 2026
df4370b
Merge remote-tracking branch 'origin/design/hotspot-split-m2-promotio…
bootjp Jul 18, 2026
7c1f0aa
distribution: timestamp completed split jobs
bootjp Jul 18, 2026
737b930
kv: preserve migration fence bypasses
bootjp Jul 18, 2026
7cc8008
Merge hotspot split promotion updates
bootjp Jul 18, 2026
0c74b60
Complete split migration runner phases
bootjp Jul 18, 2026
634a75e
Complete hotspot split M2 migration lifecycle
bootjp Jul 18, 2026
1cbee6a
Track post-arm two-phase commits during split
bootjp Jul 18, 2026
8264ea3
Close split migration startup and retry gaps
bootjp Jul 18, 2026
28449f9
Complete hotspot split M2 migration lifecycle (#1096)
bootjp Jul 19, 2026
db933c0
docs: mark hotspot split M2 implemented
bootjp Jul 19, 2026
f270d8d
docs: link implemented hotspot split design
bootjp Jul 19, 2026
f2aad59
migration: complete target promotion catalog state
bootjp Jul 19, 2026
54cc7b9
migration: harden split cutover compatibility
bootjp Jul 19, 2026
48a4da8
migration: satisfy current lint gates
bootjp Jul 19, 2026
19c2657
Resolving merge conflicts with base branch
Copilot Jul 20, 2026
6b54f22
docs: resolve merge conflicts with base branch
Copilot Jul 20, 2026
20cebac
Keep hotspot M2 status PR docs-only
bootjp Jul 22, 2026
4ed488c
Mark hotspot split M2 design implemented (#1124)
bootjp Jul 23, 2026
ebf6878
proto: reserve raft admin status fields
bootjp Jul 23, 2026
f79bc00
migration: harden promotion readiness fences
bootjp Jul 23, 2026
4163665
adapter: fail closed on split capability regression
bootjp Jul 23, 2026
d57699d
migration: harden split cleanup guards
bootjp Jul 23, 2026
dcb7744
migration: preserve cleanup metadata barriers
bootjp Jul 24, 2026
75d86c0
migration: scope source read drain to pre-cutover reads
bootjp Aug 21, 2026
37b1d8f
migration: prove readiness before key-only scans
bootjp Aug 28, 2026
b5eea8c
migration: recover when the importer is ahead of copy progress
bootjp Aug 29, 2026
b216767
migration: record the source group on the split job
bootjp Aug 29, 2026
f81057b
migration: leave resolver-owned SQS rows out of route cleanup
bootjp Aug 29, 2026
67ee758
Merge base branch design/hotspot-split-m2-cross-group
bootjp Sep 4, 2026
0ae4697
kv: clean up after the base merge
bootjp Sep 4, 2026
5876404
adapter: settle the S3 bucket-auxiliary export owner rule after the m…
bootjp Sep 4, 2026
557c542
migration: unify S3 auxiliary ownership and halt apply on unprovable …
bootjp Sep 4, 2026
b667077
kv: halt only on unprovable local readiness, and on readiness persist…
bootjp Sep 5, 2026
6fb87e4
kv: classify apply halts by process-locality, not by call site
bootjp Sep 5, 2026
04f51f5
kv: halt batched applies on an unproven readiness verdict
bootjp Sep 12, 2026
eb48ed2
adapter: give the promotion fixture the source group a planner would set
bootjp Sep 12, 2026
35fc04d
Merge main into design/hotspot-split-m2-promotion-complete
bootjp Oct 11, 2026
35b6fa1
Merge commit '16b56f2d7a8c184e5ffba8faeb9a7df477707ff9' into HEAD
bootjp Oct 11, 2026
618d4ab
migration: close split safety gaps
bootjp Oct 22, 2026
66cca4d
Merge main into hotspot split promotion
bootjp Oct 22, 2026
6b4af2b
Fix migration apply lock ordering
bootjp Oct 22, 2026
ecdcb9b
Strengthen migration lock order test
bootjp Oct 22, 2026
c380480
Check Pebble test store assertion
bootjp Oct 22, 2026
3dfa8f7
Authenticate migration control and bound voter probes
bootjp Oct 22, 2026
86928cd
Protect internal migration mutations and configure test authentication
bootjp Oct 22, 2026
06d5109
Authenticate migration exports and encrypt control credentials
bootjp Oct 22, 2026
5d9b61b
Isolate migration authority and harden split runner recovery
bootjp Oct 22, 2026
84e0b50
Recover compacted legacy jobs and separate RPC attempt budgets
bootjp Oct 22, 2026
06cd398
Bound remaining migration control RPC attempts
bootjp Oct 22, 2026
2405abb
Authenticate migration probes and persist target clock floors
bootjp Oct 22, 2026
92d9ed9
Authenticate peer forwards and validate cleanup authority
bootjp Oct 22, 2026
8228a97
Stage peer authentication before enabling migration enforcement
bootjp Oct 22, 2026
6161878
Validate migration transport and retire routed snapshot seals
bootjp Oct 22, 2026
a49b9c4
Persist split phase failures and restore gated TLS queries
bootjp Oct 22, 2026
07d1343
Merge main and preserve migration guards in shared paths
bootjp Oct 22, 2026
629340a
Preserve migration retries during leader churn and Raft replay
bootjp Oct 22, 2026
d15bf0f
Merge main integration regression fixes
bootjp Oct 22, 2026
6568983
Protect staged migration jobs and complete operator recovery
bootjp Oct 22, 2026
6b4aca9
Merge main and secure full-range migration control deletes
bootjp Oct 22, 2026
ed52cb5
Restore source writes before abandoned target cleanup
bootjp Oct 22, 2026
90a87ec
Reject catalog migrations across resolver-owned SQS routes
bootjp Oct 22, 2026
2c58c1e
Merge prepare evidence main with migration safeguards
bootjp Oct 22, 2026
57f4e95
Merge shutdown main and verify migration evidence integration
bootjp Oct 22, 2026
9fc6a9d
store: permanently reject retired migration mutations
bootjp Oct 22, 2026
1f3d622
WIP: checkpoint native migration ownership evidence
bootjp Oct 22, 2026
6bd837f
raft: validate external snapshot restore origins before startup
bootjp Oct 22, 2026
86111b7
Validate snapshot restore origin before publishing FSM headers
bootjp Oct 22, 2026
cd8a83c
kv: validate TSO snapshot restore origins and legacy payloads
bootjp Oct 22, 2026
b6c5fc1
store: guard external snapshot restores against migration state
bootjp Oct 22, 2026
db85271
Verify external KV and TSO restore lineage across store formats
bootjp Oct 22, 2026
9ac2c4b
Make migration apply admission deterministic
bootjp Oct 22, 2026
172bede
kv: test encrypted external restore lineage
bootjp Oct 22, 2026
6fe33ba
Add migration transfer preflight and compensation
bootjp Oct 22, 2026
d5387e7
WIP: checkpoint migration ownership runtime attestations
bootjp Oct 22, 2026
2004149
test: exercise complete migration ownership snapshot evidence
bootjp Oct 22, 2026
ada79fe
raft: retain external restore origin across restarts
bootjp Oct 22, 2026
2a56b04
raft: resync completed external restore bindings on retry
bootjp Oct 22, 2026
8d548a8
Refresh durable migration ownership through authenticated root attest…
bootjp Oct 22, 2026
dd6b9cc
Test ownership refresh refusal after sequential range splits
bootjp Oct 22, 2026
f5634d1
WIP: bind source ownership and public admission
bootjp Oct 22, 2026
4a931d8
Wire migration admission while keeping protocol activation closed
bootjp Oct 23, 2026
37ef634
Build KV migration fixtures with complete ownership evidence
bootjp Oct 23, 2026
28d256d
adapter: validate cleanup before privileged migration dispatch
bootjp Oct 23, 2026
f0a911e
Bound source ownership probe attempts
bootjp Oct 23, 2026
ec1e1b7
Rebind destination configuration after external restore
bootjp Oct 23, 2026
75894e2
Validate prefix deletes against complete route proof coverage
bootjp Oct 23, 2026
2d1a36a
Admit every prefix broadcast participant before committing
bootjp Oct 23, 2026
a6492c6
store: distinguish logical user keys during external restore
bootjp Oct 23, 2026
4ec7fab
Reject direct mutations of migration store metadata
bootjp Oct 23, 2026
06400ad
Merge current main into migration review integration
bootjp Oct 23, 2026
af71541
Define ownership partition protocol interfaces
bootjp Oct 23, 2026
f4fb72e
raftadmin: check learner protocol before promotion
bootjp Oct 23, 2026
9241bbf
test: isolate pending promotion and legacy hook behavior
bootjp Oct 23, 2026
06e37c4
Separate installed partition support from active migration readiness
bootjp Oct 23, 2026
9be6a3c
kv: add explicit moving-range transfer size guard
bootjp Oct 23, 2026
cacd6f3
Persist immutable root ownership partition manifests
bootjp Oct 23, 2026
9b12a21
Merge current main into migration implementation
bootjp Oct 23, 2026
bb6748a
Add migration protocol membership admission checks
bootjp Oct 23, 2026
4ece9ca
Restrict forwarded admin payloads and protect partition ledger writes
bootjp Oct 23, 2026
36d1719
Persist split partition lineage and working source route atomically
bootjp Oct 23, 2026
7045c53
store: preserve atomic ownership partitions and cached admission
bootjp Oct 23, 2026
13efbc5
main: snapshot all migration apply members at an applied epoch
bootjp Oct 23, 2026
58ce1f4
adapter: require all-member transfer guard admission witnesses
bootjp Oct 23, 2026
12fdb21
Test migrated ownership across later range splits
bootjp Oct 23, 2026
f1c01b5
Test partition ledger conflicts before route publication
bootjp Oct 23, 2026
964abaf
kv: gate namespace admission on durable member agreement
bootjp Oct 23, 2026
7095904
store: isolate attestation inputs and protect replay watermark
bootjp Oct 23, 2026
f9b80a6
store: retain unknown legacy barriers after partition adoption
bootjp Oct 23, 2026
8d27147
kv: admit active ownership frontiers without all-shard read scans
bootjp Oct 23, 2026
4b2b6d0
kv: verify installed partition admission protocol paths
bootjp Oct 23, 2026
62dad94
store: share versioned migration configuration codec
bootjp Oct 23, 2026
b697b26
store: accept activated namespace epochs in partition controls
bootjp Oct 23, 2026
5714ca8
Connect working source reconciliation to installed partition runtime
bootjp Oct 23, 2026
4336227
adapter: gate transfer phases on durable guard admission
bootjp Oct 23, 2026
eef934d
migration: negotiate namespace activation and prejoin permissions
bootjp Oct 23, 2026
c141fac
Add replicated ownership partition control and root refresh
bootjp Oct 23, 2026
32a68bb
Negotiate namespace admission before partition reconciliation
bootjp Oct 23, 2026
3e738dd
jepsen: cover bounded same-owner and cross-group resplits
bootjp Oct 23, 2026
05d5b64
Exclude adopted job history from active ownership admission
bootjp Oct 23, 2026
0f389bc
Avoid duplicate adopted jobs in partition reconciliation
bootjp Oct 23, 2026
dec9bb0
adapter: require namespace admission for migration mutation RPCs
bootjp Oct 23, 2026
2113214
Verify partition control durability across Pebble reopen
bootjp Oct 23, 2026
986d79b
Refactor migration control validation and dispatch
bootjp Oct 23, 2026
df4018d
adapter: avoid redundant namespace activation proposals
bootjp Oct 23, 2026
8af7588
Validate partition geometry and member protocols before side effects
bootjp Oct 23, 2026
8dd44ee
kv: simplify admission predicates and remove obsolete proof selectors
bootjp Oct 23, 2026
6786804
Refactor namespace admission validation for strict lint
bootjp Oct 23, 2026
5de0d2c
Test migration admission with real Raft quorum and learner restart
bootjp Oct 23, 2026
7a029ef
Test fence drain and copy timeouts with real transfer admission
bootjp Oct 23, 2026
4e1eaeb
Merge current main and contributor sign-off policy
bootjp Oct 23, 2026
031fa47
adapter: extract coherent namespace activation phase
bootjp Oct 23, 2026
ad71616
Reconcile historical nonowner partition geometry safely
bootjp Oct 23, 2026
b05bd77
Validate ownership control budget before publishing split geometry
bootjp Oct 23, 2026
61a6bb7
test: add migration codec properties
bootjp Oct 23, 2026
b2180e9
Fence quorum restart snapshots by acknowledged write index
bootjp Oct 23, 2026
fb45960
kv: index durable frontier evidence and select disjoint ranges linearly
bootjp Oct 23, 2026
812d918
Refuse split geometry when native owner evidence is unavailable
bootjp Oct 23, 2026
989f4bf
Extract negative partition geometry eligibility
bootjp Oct 23, 2026
16e1e2f
Test quorum prepared drains and historical transfer preflight
bootjp Oct 23, 2026
341238b
Gate migration readiness on installed runtime and applied configuration
bootjp Oct 23, 2026
51bc35f
Fence native split evidence and bound both endpoint control sizes
bootjp Oct 23, 2026
3d9629c
test: guard move-back target partition control budget
bootjp Oct 23, 2026
a2996ef
Require dedicated operator authentication for catalog splits
bootjp Oct 23, 2026
e094e7f
Test quorum commits across forced leadership handoff
bootjp Oct 23, 2026
e775a75
Refresh serving ownership closures after partition catalog changes
bootjp Oct 23, 2026
572a209
Acknowledge disjoint owners before completing catalog splits
bootjp Oct 23, 2026
7328918
Retry serving-owner barriers after working split recovery
bootjp Oct 23, 2026
9975654
Bound snapshot churn in native migration acceptance
bootjp Oct 23, 2026
79820b1
adapter: bound namespace activation RPC attempts
bootjp Oct 23, 2026
5449c01
Keep pending transfer acknowledgements retryable
bootjp Oct 23, 2026
ec37113
Retry supported namespace activation acknowledgements
bootjp Oct 23, 2026
7081873
Run full gRPC sequences in a separate CI phase
bootjp Oct 23, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
9 changes: 8 additions & 1 deletion .github/workflows/go-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ permissions:
contents: read
jobs:
test:
env:
GRPC_SEQUENCE_TESTS: '^(Test_consistency_satisfy_write_after_read_sequence|Test_grpc_transaction)$'
strategy:
matrix:
os: [ [ubuntu-latest] ]
Expand All @@ -27,7 +29,12 @@ jobs:
run: sudo apt-get update && sudo apt-get install -y fuse3
- name: Reject production imports of test support
run: bash scripts/check-production-imports.sh
- run: go test -race ./...
- name: Run race tests outside full-length gRPC sequences
run: go test -race ./... -skip "$GRPC_SEQUENCE_TESTS"
env:
# Fail, rather than skip, the kernel-mount tests when FUSE is unusable.
ELASTICKV_REQUIRE_FUSE: "1"
# These unchanged 10,000-iteration tests need a fresh package budget
# after the serial migration/snapshot acceptance tests have finished.
- name: Run full-length gRPC consistency sequences
run: go test -race ./adapter -run "$GRPC_SEQUENCE_TESTS"
38 changes: 38 additions & 0 deletions adapter/distribution_job_read_gate_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package adapter

import (
"context"
"testing"

"github.com/bootjp/elastickv/distribution"
pb "github.com/bootjp/elastickv/proto"
"github.com/bootjp/elastickv/store"
"github.com/stretchr/testify/require"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
)

func TestDistributionServerJobReadsHonorStartupGate(t *testing.T) {
t.Parallel()
ctx := context.Background()
catalog := distribution.NewCatalogStore(store.NewMVCCStore())
job := sampleDistributionSplitJob(13)
require.NoError(t, catalog.CreateSplitJob(ctx, job))
blocked := true
server := NewDistributionServer(nil, catalog, WithDistributionReadGate(func() bool { return blocked }))
_, err := server.GetSplitJob(ctx, &pb.GetSplitJobRequest{JobId: job.JobID})
require.Equal(t, codes.Unavailable, status.Code(err))
_, err = server.GetSplitJob(ctx, &pb.GetSplitJobRequest{JobId: 99})
require.Equal(t, codes.Unavailable, status.Code(err), "catch-up must not return a stale NotFound")
_, err = server.ListSplitJobs(ctx, &pb.ListSplitJobsRequest{})
require.Equal(t, codes.Unavailable, status.Code(err))
blocked = false
got, err := server.GetSplitJob(ctx, &pb.GetSplitJobRequest{JobId: job.JobID})
require.NoError(t, err)
require.Equal(t, job.JobID, got.GetJob().GetJobId())
listed, err := server.ListSplitJobs(ctx, &pb.ListSplitJobsRequest{})
require.NoError(t, err)
require.Len(t, listed.GetJobs(), 1)
_, err = server.GetSplitJob(ctx, &pb.GetSplitJobRequest{JobId: 99})
require.Equal(t, codes.NotFound, status.Code(err))
}
Loading
Loading