Commit Graph
6926 Commits
Author SHA1 Message Date
Grant Limberg ca3d17ddb0 controller: log how long each BigTable batch write took
Timed in the worker around the BulkApply call; reported on the per-batch
completion line and the exception line.  Gives a direct client-observed
latency signal to compare against Bigtable's server-side metrics.
2026-07-21 16:54:09 +02:00
Grant Limberg 2e7e4a58a8 controller: write BigTable status batches from sync worker threads; re-queue failures
Replace AsyncBulkApply with synchronous BulkApply calls fanned out to a
small worker pool (8 threads, 500-row batches).  The async client path
makes progress only on the connection's shared background event threads,
which stall for tens of seconds at a time in production (observed
2026-07-21: 26k-row flushes taking 3.5-8 minutes against a near-idle
cluster with server-side MutateRows p99 of 50-80ms, completions arriving
in window-sized bursts).  A sync call is driven entirely by its own
thread and has months of healthy history in this environment.

Batches are built and their results processed on the calling thread, so
_lastNodeInfo and the re-queue list stay lock-free; workers only perform
the RPC and record the outcome.

Also stop dropping failed mutations: re-queue them for the next cycle
(idempotent replays via deterministic cell timestamps, backlog capped by
requeuePendingStatus) unless the status is INVALID_ARGUMENT.  This
covers transient per-mutation failures the client does not retry
internally, e.g. ACCESS_TOKEN_EXPIRED and UNAVAILABLE.
2026-07-21 16:29:10 +02:00
Grant Limberg b2bd72953a smaller parallel batches of writes 2026-07-21 10:48:19 +02:00
Grant Limberg 2f0cae4447 bootstrap-deps: force WITH_API_ONLY=OFF in the full OTel build
A stale .deps-build/otel CMake cache from an API-only run kept
WITH_API_ONLY=ON even under ZT_CONTROLLER_DEPS=1, silently installing an
API-only opentelemetry-cpp; the controller configure then fails with
"Component sdk is not a built component". Pass the flag explicitly so
the full build always overrides a cached value.
2026-07-21 02:15:57 +02:00
Grant Limberg 121ce0e8b9 controller: chunk BigTable status writes under the 100k mutation limit
Bigtable's MutateRows API rejects requests with more than 100,000
mutations total, and google-cloud-cpp sends a BulkMutation as a single
request -- it never splits by mutation count. writePending() built one
batch from every pending check-in (up to 5 SetCells per row), so a cold
node_info cache after a controller restart could push a single flush far
past the limit (observed: 124582). INVALID_ARGUMENT is permanent, so the
whole batch failed and those check-ins were dropped for the cycle.

Flush in chunks of at most 25,000 mutations. Failure handling is now
per-chunk: FailedMutation::original_index() aligns against a chunk-local
row-hash vector, and if BulkApply throws, only the not-yet-written tail
is re-queued so already-applied chunks are not replayed.
2026-07-21 02:15:46 +02:00
Grant Limberg 53acb42f11 controller: erase netconf request de-dup key if enqueue throws 2026-07-02 12:29:32 -07:00
Grant Limberg 54b61f3927 set max netconf queue length to 2M requests 2026-07-02 12:28:56 -07:00
Grant Limberg 4097f646a9 cap & de-dupe netconf request queue 2026-07-02 12:22:53 -07:00
Grant Limberg 9a0f635045 Set a minimum of 8 threads for netconf request handling in the Central controllers 2026-07-02 12:21:50 -07:00
Grant Limberg 50bfed682a don't do migrations via the startup script 2026-07-01 18:47:06 -07:00
Grant Limberg cb65567de3 Fix possible UB in calling operator[] on a const json& 2026-07-01 18:45:05 -07:00
Grant Limberg 5951981622 Merge pull request #2526 from zerotier/gl/ctl-pubsub
Add PubSub and BigTable support for Central hosted network controllers
2026-06-29 11:55:55 -07:00
Grant Limberg 1f6a1fd51f Remove ZT_CONTROLLER=1 from makefile. No longer used to build central
controllers
2026-06-29 11:13:40 -07:00
Grant Limberg edcc066d25 Add a SIGSEGV handler to print a stack trace for central controllers
Only enabled in the central controller builds.  Trying to find more info
about some mystery controller restarts in prod
2026-06-26 13:33:07 -07:00
Grant Limberg 0797626b3e Fix a potential crash on central controller shutdown 2026-06-26 13:32:09 -07:00
Grant Limberg 4bcff9d3e3 Fix the sso template for errors returned by IdP
Template was looking for {{networkId}} but that hadn't been populated
yet in the case where the IdP returned an error. This caused the
template parsing to crash and return its own error, disguising the error
from the IdP
2026-06-22 09:47:24 -07:00
Grant Limberg 64cc25baf6 bump actions to get rid of node warnings 2026-06-17 16:51:08 -07:00
Grant Limberg 8304ec79fe update documentation for ConnectionPool 2026-06-17 16:39:32 -07:00
Grant Limberg fcb016b9c1 standardize log formatting across the controller 2026-06-17 16:20:17 -07:00
Grant Limberg 75b51ec229 Ensure everything in nonfree/controller has the proper header comment
pointing to LICENSE.TXT
2026-06-17 13:50:44 -07:00
Grant Limberg 5640b82252 Update build.sh with build instructions
Also add presets for the BSDs
2026-06-17 13:39:22 -07:00
Grant Limberg ab9efc722c use the checkin timestamps for the cell timestamps in BigTable 2026-06-17 13:10:23 -07:00
Grant Limberg 4706ed9682 enable metrics by default for the central controller 2026-06-17 12:45:07 -07:00
Grant Limberg bf426497b0 Conneciton pool update to a timed wait on connection pool exhaustion
More use of scoped RAII guard for connections where appropriate.
2026-06-17 10:54:57 -07:00
Grant Limberg afd8a828df fix printf, connection pool smart pointer semantics, wait for ready spin
lock -> notification, and double notify on erase
2026-06-17 10:17:51 -07:00