Commit Graph

664 Commits

Author SHA1 Message Date
Zhe Wu 359b3a11e7 Change TLog pull async data warning timeout 2023-01-11 19:36:00 -08:00
Zhe Wu 087d37d10b Add event for txn server initialization and a warning for TLog slow catching up 2023-01-11 10:02:06 -08:00
Xiaoxi Wang 8266f52dea
Merge pull request #9012 from sfc-gh-xwang/feature/main/wiggleDelay
Persist accumulated wiggle delay
2023-01-04 16:14:09 -08:00
Xiaoxi Wang bbcb3cc018 extract KeyBackedConfig, StorageWiggleData class; solve template resolution problem; solve MV txn and native api conflict by splitting RunTransaction file 2023-01-02 23:34:39 -08:00
Jingyu Zhou 667d58ac35 Add back samples for (non)empty peeks stats
These were lost, likely due to refactoring. Now TLogMetrics have meaningful
data like:

TLogMetrics ID=59ec9c67b4d07433 Elapsed=5 BytesInput=0 -1 17048 BytesDurable=47.4 225.405 17048 BlockingPeeks=0 -1 0 BlockingPeekTimeouts=0 -1 0 EmptyPeeks=1.6 2.79237 236 NonEmptyPeeks=0 -1 32 ...
2022-12-21 11:18:28 -08:00
FoundationDB CI 86d6106dc1
format source code after switch to clang 15 2022-12-08 17:26:45 +00:00
Daniel Luan 4be05e5a5d Upgrade C++ Standard to 20 2022-12-06 14:19:06 -08:00
Yi Wu 551fd0b9bb
EAR: Cleanup Redwood tenant map usage (#8902)
We have a recent redesign that no longer required to pass tenant name to get encryption key, and also not allowing optional tenant mode for tenant-aware encryption. This PR clean up Redwood code to remove tenant map usage, and update various checks accordingly.

Changes:
* Cleanup TenantPrefixIndex in TenantAwareEncryptionKeyProvider and related logic in storage server and Redwood for passing the map around.
* Cleanup and update DecodeBoundaryVerifier the reflect the new design.
* A minor fix to writePages() that avoid a page that's default domain encrypted having a lower bound key belonging to a non-default domain.
* Fix TenantAwareEncryptionKeyProvider::getEncryptionDomain() returning wrong prefix long for system domain.
* A minor change to add a context string to IoTimeoutError.
2022-11-23 09:41:40 -08:00
sfc-gh-tclinkenbeard 3c97f43138 Change Histogram::Unit::microseconds to milliseconds 2022-11-21 08:03:56 -08:00
Jingyu Zhou f285a91f6c Add more debug events 2022-11-17 11:54:21 -08:00
Steve Atherton 8e8c4b4489
Merge pull request #8170 from sfc-gh-sgwydir/ddsketch
Use DDSketch for sample data
2022-11-17 10:38:12 -08:00
Sam Gwydir 214db4d17e formatting 2022-11-15 13:38:55 -08:00
sfc-gh-tclinkenbeard c03f60c618 Update rare code probe annotations 2022-11-15 13:21:25 -08:00
Sam Gwydir 7f33b0fa70 clang-format 2022-11-12 14:09:31 -08:00
Sam Gwydir 23706c957b Use DDSketch for Sample Data. 2022-11-12 13:45:46 -08:00
Zhe Wu ae4d66c0d7 Update TLogServer in main 2022-11-04 15:05:37 -07:00
Zhe Wu fc35ed9d0a Change ASSERT_WE_THINK to ASSERT when checking that peek reply start version must be greater than latest pop version 2022-11-04 15:05:37 -07:00
Zhe Wu 32bc9b6ebb Fix a race condition between batched peek and pop, where the server removal pop may be lost 2022-11-04 15:05:37 -07:00
Ata E Husain Bohra a7d123643d
Extend Tlog persistentStorage to persist encryption state (#8344)
* Extend Tlog persistentStorage to persist encryption state

Description

 diff-3: Address review comment.
 diff-2: Extend ClusterController endpoints to allow query
         cluster's encryptionAtRest status
         Update Tlog recovery to ensure on-disk encryption
         status matches with cluster's cstate persisted
         encryptionAtRest
 diff-1: Store encryptionAtRestMode state in Coordinators

Major changes proposed are:
1. Extend TLog persistentStorage to persist encryption state
2. Encryption state persisted is derived from corresponding
db-config and relevant SERVER_KNOBS. In near future, knobs
shall be removed.
3. On TLog startup, the persisted encryption state is compared
against cluster configuration, if mismatch, the TLog is killed
and not allowed to rejoin the cluster.

Testing

devRunCorrectness - 100K
2022-11-03 11:16:50 -07:00
Lukas Joswiak 28540e5962 Format 2022-10-27 13:56:13 -07:00
Lukas Joswiak 9d3c3b1efe Remove cluster ID logic from individual roles
The logic to determine the validity of a process joining a cluster now
belongs on the worker and the cluster controller. It is no longer
restricted to tlogs and storages, but instead applies to all processes
(even stateless ones).
2022-10-27 13:56:13 -07:00
Lukas Joswiak 72a97afcd6 Avoid recruiting workers with different cluster ID 2022-10-27 13:56:13 -07:00
sfc-gh-tclinkenbeard 74212eeacf Encapsulate CounterCollection 2022-10-25 10:17:15 -07:00
Ankita Kejriwal 854212fe94 Incorportate code review suggestions 2022-10-13 17:41:31 -07:00
Ankita Kejriwal 59686fa2e5 Increase the IO timeout to avoid flakiness in simulation tests. 2022-10-13 13:40:40 -07:00
Steve Atherton 8ccdc91b5e Merge commit '7c89cd705faee52d5d78e6c77665cb7cc4502f58' into redwood-commit-overlap 2022-10-07 15:59:45 -07:00
Markus Pilman ea1325a552
Merge pull request #8319 from sfc-gh-tclinkenbeard/add-rare-code-probe-annotation
Add `rare` code probe decoration
2022-10-07 09:39:00 -06:00
Steve Atherton c1b2519b9c Remove additional calls to KVS init in TLogServer in favor of a single call at startup. 2022-10-06 13:14:24 -07:00
Steve Atherton f2dbbcce40 Allow overlapping commits in Redwood in which the caller drops the commit futures. Call IKVS::init() in TLogServer. 2022-10-06 12:48:06 -07:00
Ata E Husain Bohra 201eac77cf
Init TLogPersistent storage for a sharedTLog (#8363)
* Init TLogPersistent storage for a sharedTLog

Description

  diff-1: Address review comments

Patch udpates the code to intialize TLogPersistent storage for a
shared TLog independent of intializing persistentState for a
versioned Tlog data. Appraoch allows initializing Tlog persistent
storage as well as writing 'persistFormat' key for a shared TLog
earlier in the TLog creation lifecycle.

Testing

devRunCorrectness - 100K
2022-09-30 14:06:53 -07:00
sfc-gh-tclinkenbeard 985958c260 Add rare code probe decoration 2022-09-25 15:28:32 -07:00
Lukas Joswiak c97377f48e
Remove durable cluster ID write (#8238) 2022-09-20 07:56:07 -07:00
A.J. Beamon 4fd64630e8 Convert literal string ref instances to use _sr suffix 2022-09-19 11:35:58 -07:00
Evan Tschannen f5161c362e
fix: persistentData->commit() was not protected by the persistentDataCommitLock (#8200)
* fix: persistentData->commit() was not protected by the persistentDataCommitLock, meaning it is possible for inconsistent data to be made durable on the tlog

* fixed a compilation error
2022-09-16 09:47:20 -07:00
sfc-gh-tclinkenbeard 82adc1e856 Make g_simulator a pointer 2022-09-15 09:00:33 -07:00
Josh Slocum fdb509c99e
2 TLog stopped bug fixes - one setting stop from dbinfo, the other handling a race between peek and stopping (#8001) 2022-08-29 15:25:29 -05:00
Dan Adkins 4317e528ab
Guard initPersistentState() calls with timeout. (#7649)
We've observed the recovery process stuck in initPersistentState,
while waiting to acquire persistentDataCommitLock. All of the
other places in that function which potentially interact with a
disk are guarded by a timeout: TLOG_MAX_CREATE_DURATION.

Since it's possible that the current holder of that lock is
stuck in persistentData->commit(), it makes sense to add
a timeout around the entire function, rather than each of the
places where it might get stuck on an I/O operation.

The end result is that after 10 seconds, this process will fail
and cluster recovery will restart.
2022-08-15 10:02:03 -07:00
Zhe Wu 410ad5ff18 TLog track unpopped recovery tag 2022-07-25 20:10:18 -07:00
Zhe Wu aa2740e21e Increase AllTags field length in TLogReady 2022-07-20 13:17:21 -07:00
Markus Pilman 1de37afd52
Make TEST macros C++ only (#7558)
* proof of concept

* use code-probe instead of test

* code probe working on gcc

* code probe implemented

* renamed TestProbe to CodeProbe

* fixed refactoring typo

* support filtered output

* print probes at end of simulation

* fix missed probes print

* fix deduplication

* Fix refactoring issues

* revert bad refactor

* make sure file paths are relative

* fix more wrong refactor changes
2022-07-19 13:15:51 -07:00
Markus Pilman 4ece33a0a8
Merge pull request #7445 from sfc-gh-anoyes/anoyes/fix-ubsan
Fix UBSAN build when statically linking libcxx
2022-07-11 17:27:37 -06:00
Andrew Noyes 55548e4ac8 Avoid signed integer overflow 2022-07-07 10:19:20 -07:00
A.J. Beamon c4b0f6eaae
Add an internal C API to support connection to a cluster using a connection string (#7438)
* Add an internal C API to support memory connection records

* Track shared state in the client using a unique and immutable cluster ID from the cluster

* Add missing code to store the clusterId in the database state object

* Update some arguments to pass by const&
2022-07-07 10:12:49 +02:00
Yi Wu 364644673f
Support TLog encryption in commit proxy (#6942)
This PR add support for TLog encryption through commit proxy. The encryption is done on per-mutation basis. As CP writes mutations to TLog, it inserts encryption header alongside encrypted mutations. Storage server (and other consumers of TLog such as storage cache and backup worker) decrypts the mutations as they peek TLog.
2022-06-29 14:21:05 -07:00
Chaoguang Lin 29f98f3654
Avoid duplicate snapshot on one process if it serves as multiple roles (#7294)
* Fix comments

* Add simulation value for SERVER_KNOBS->SNAP_CREATE_MAX_TIMEOUT

* A work version with correctness clean

* Remove unnecessay comments; debugging symbols

* Only check secondary address for coordinators, same as before

* Change the trace to SevError and remove the ASSERT(false)

* Remove TLogSnapRequest handling on TlogServer, which is changed to use WorkerSnapRequest

* Add retry for network failures

* Add retry limit for network failures; still allow duplicate snapshots on processes are both tlog and storage to avoid race

* Add retry limit as a knob and make backoff exponentail

* Add getDatabaseConfiguration(Transaction* tr)

* revert back to send request for each role once

* update some comments
2022-06-29 11:23:07 -07:00
Andrew Noyes 1f8fc32f41
Save a memcpy in the tlog peek path (#7328) 2022-06-07 13:22:56 -07:00
Jingyu Zhou ae5818afa8
Merge pull request #7240 from jzhou77/fix-7109
CC sends recovery txn version during TLog recruitment
2022-05-27 09:27:19 -07:00
Jingyu Zhou b2fded5c51 CC sends recovery txn version during TLog recruitment
This simplifies the logic for TLog to wait for recovery txn before replying
back to peeks.
2022-05-24 14:57:55 -07:00
Andrew Noyes 53882ef741 Revert most logic in #5637 2022-05-24 12:23:49 -07:00
Xiaoxi Wang 5a431980d2 Merge branch 'main' of https://github.com/apple/foundationdb into features/debug-macro 2022-05-20 12:18:20 -07:00