Commit Graph

222 Commits

Author SHA1 Message Date
neethuhaneesha e84f4ec4e1
Tx mutations, LogProtocolMessage, SpanContextMessage need to be skipped before coverting them to mutations (#12604) 2025-12-21 12:39:24 -08:00
Jingyu Zhou 1693a718ae
Fix assertion failure due to small knob value (#12114)
Increase the buffer size for backup workers and rename the knob.

Seed: -f ./tests/slow/ParallelRestoreNewBackupCorrectnessAtomicOp.toml -s 3120109021 -b on
2025-04-29 14:22:47 -07:00
Jingyu Zhou f1ecdb3a99
Fix backup worker assertion failure on memory usage (#12046)
* Fix backup worker assertion failure on memory usage

pullAsyncData() can be cancelled thus not take() some of the memory used by
the in memory queue.

20250320-171737-jzhou-752fd8c45fdadd4a

100k tests/slow/ParallelRestoreNewBackupCorrectnessAtomicOp.toml
20250320-172251-jzhou-3bc7db8e7ce5e1de

* Refactor such that messages in the queue have to reserve memory first

Thus, when we release the memory, it must have already been reserved.

100k ParallelRestoreNewBackupCorrectnessAtomicOp.toml
20250320-234748-jzhou-a159972dd0a72e03

20250320-235252-jzhou-54a6ae8c67873b59

* Fix a backup worker assertion failure

The pop version obtained from GRV proxy replies may go backwards, which can
cause assertion failure when pulling mutations, i.e., missing mutations. Fix
this bug and add an assertion that popVersion can go lower.

100k 20250321-012019-jzhou-01eb56938cf0a3fc

100k tests/slow/ParallelRestoreNewBackupCorrectnessAtomicOp.toml
20250321-012144-jzhou-68181bb51aedbb5d

* Fix assertion failure of triggered version

The triggered version could be the same as popVersion.

20250321-025429-jzhou-a088c3f119331b93

100k tests/slow/ParallelRestoreNewBackupCorrectnessAtomicOp.toml
20250321-025532-jzhou-77e2dbd5fd035157

* Update fdbserver/BackupWorker.actor.cpp

Co-authored-by: Syed Paymaan Raza <1238752+spraza@users.noreply.github.com>

---------

Co-authored-by: Syed Paymaan Raza <1238752+spraza@users.noreply.github.com>
2025-03-21 13:55:27 -07:00
Jingyu Zhou d7f4d03805 Fix an assertion failure
lock->release(toRelease) can trigger assertion failure that release size is larger
than the active size. This is because lock->take() has not returned yet. So the
memory released has not been reserved. Fix by breaking release into two steps.
After the first release(), the lock->take() will be unblocked, thus the second
release() does the correct accounting.

gcc correctness:
20250319-002950-jzhou-a9ecc09dd1c8812a
2025-03-19 11:09:45 -07:00
Jingyu Zhou e970d6f60a Address a comment
20250318-000905-jzhou-f92206b417dfabb7
2025-03-19 11:09:45 -07:00
Jingyu Zhou c8b887dc85 Fix lock take bytes
Avoid calling take() when the number of bytes is 0 and add an overhead factor
for memory usage of a mutation.
2025-03-19 11:09:45 -07:00
Jingyu Zhou c5a3482a5f Change backup worker memory accounting to use message sizes
Previously I used arena size for accouting, which has problems such as arena
memory usage changes and arena memory block circular reference. And we are
acquiring flow lock multiple times, even though the cursor has already fetched
data into memory.

This change simplifies the accounting to just use message sizes, reducing the
number of flow lock acquisitions.
2025-03-19 11:09:45 -07:00
Jingyu Zhou 1690af5acb Address comments 2025-02-17 09:52:28 -08:00
Jingyu Zhou 4939cd84a9 Fix start version for pullAsyncData 2025-02-17 09:50:29 -08:00
Jingyu Zhou 4196864eb4 Delay updating pop version in noop mode until it's saved
Otherwise, the pop version can become larger than the actual saved version when
switching to the regular pulling mode. Because the pop version is larger,
mutations larger than saved version could be popped and no long available.
2025-02-17 09:50:29 -08:00
Jingyu Zhou 048374ae9b It's fine to ignore mutations if noop mode popped them 2025-02-17 09:50:29 -08:00
Jingyu Zhou 1bd6f0aeab Save NOOP progress of backup workers
This is needed so that CC knows the lower bound of versions that can be included
in a backup.
2025-02-17 09:50:29 -08:00
Jingyu Zhou d9f04dc247 Fix start version after backup worker exits noop mode 2025-02-17 09:50:29 -08:00
Jingyu Zhou 6a07744672 Handle cases when backup worker pulling may miss mutations
I.e., throw an error to trigger a recovery.
2025-02-17 09:50:29 -08:00
flowguru fe47ce24d3
New restore consolidated commit (#11901)
* New restore consolidated commit

This change adds RestoreDispatchPartitionedTaskFunc to restore
from partitioned-format backup.

* ArenaBlock::totalSize parameter pass by ref

* Fix format issues identified by CI
2025-01-22 14:54:55 -08:00
Syed Paymaan Raza c3e7542cda Update end year in copyright header 2024-08-02 09:40:11 -07:00
Dimitris Apostolou a88114c222
Fix typos 2024-02-07 01:16:00 +02:00
Hao Fu 9b17dd8caf
Fix backup workers stability issues (#11044)
This PR includes a few stability fixes for Backup Worker

* Fixed memory bookkeeping issue in Backup Worker. Previously
it didn't release flow lock correctly when erasing messages.

* Added TLogServer fix to return 0 from poppedVersion() for
unrecognized log router tags.
2023-11-13 15:55:25 -08:00
Jingyu Zhou 64a6ab7122 Add ID to DEBUG_MUTATION in backup worker 2023-05-03 13:15:18 -07:00
Nim Wijetunga 6e4e6ab2f4
Revert "Revert "Refactor GetEncryptCipherKeys (#9600)"" (#9903)
* Revert "Revert "Refactor GetEncryptCipherKeys (#9600)" (#9708)"
2023-04-05 10:03:48 -07:00
Ata E Husain Bohra dbcab0b1bd
Revert "Refactor GetEncryptCipherKeys (#9600)" (#9708)
This reverts commit 2702665e35.
2023-03-15 12:10:08 -07:00
Jingyu Zhou b755e668bf
Merge pull request #9601 from jzhou77/fix-head
Allow log router to detect slow peeks and to switch DC for peeking
2023-03-09 15:34:24 -08:00
Nim Wijetunga 2702665e35
Refactor GetEncryptCipherKeys (#9600)
* inital commit

* address pr comments
2023-03-08 17:05:03 -08:00
Jingyu Zhou 0259a243ae Switch DC if log router peek becomes stuck
Trying to a different DC if this happens.
2023-03-06 17:41:56 -08:00
Ata E Husain Bohra 99b23ac04d
EaR: Configurable encryption support for Tlog mutations (#9394)
* EaR: Configurable encryption support for TLog mutations

Description

  diff-1 : Address review comments

Major changes includes:
1. Update the code involved in ensuring Tlog mutation encryption to be
compliant with "configurable encryption" feature.
2. Update ENABLE_CONFIGURABLE_ENCRYPTION flag to be 'true' by default
and BUGGIFY it.

Testing

devRunCorrectness - 100K
2023-02-16 19:01:59 -08:00
Yi Wu fe18c87ac6
EaR: commit proxy fetch additional cipher keys post-resolution (#9308)
Commit proxy needs to fetch additional cipher keys post-resolution, since tenant ids for raw access requests and cross-tenant clear ranges are calculated after resolution.
2023-02-14 13:05:51 -08:00
FoundationDB CI 86d6106dc1
format source code after switch to clang 15 2022-12-08 17:26:45 +00:00
Jingyu Zhou d3f0e396ac Fix backup worker assertion failure
The number of released bytes exceeds the number of acquired bytes in locks.
This is because the bytes counted towards release is calculated after a "wait",
when more bytes could be allocated.
2022-11-19 09:18:49 -08:00
sfc-gh-tclinkenbeard 74212eeacf Encapsulate CounterCollection 2022-10-25 10:17:15 -07:00
A.J. Beamon 3353103d9d Fix filtering of potential backup mutations in commit proxy and backup worker; add code probe to ensure we are testing default backup sharing and add some tests to hit it 2022-09-27 15:25:30 -07:00
A.J. Beamon fda0d7223d Update backup to include system key ranges needed for tenants. Run simulated backup tests with tenants. 2022-09-22 10:00:13 -07:00
A.J. Beamon 4fd64630e8 Convert literal string ref instances to use _sr suffix 2022-09-19 11:35:58 -07:00
Yi Wu d831c87d14
Add encryption metrics (#8070)
Adding the following metrics:
* BlobCipherKeyCache hit/miss
* EKP: KMS requests latencies
* For each component that using encryption, they now need to pass a UsageType enum to the encryption helper methods (GetEncryptCipherKeys/GetLatestEncryptCipherKey/encrypt/decrypt) and those methods will help to log get cipher key latency samples and encryption/decryption cpu times accordingly.
2022-09-09 18:43:09 -07:00
Nim Wijetunga a857609478 refactor ekp interface 2022-08-23 23:04:12 -07:00
Steve Atherton 9a6387af70
Merge pull request #7582 from sfc-gh-yiwu/encrypt_mutation
Make encrypted mutation serialize as normal mutations
2022-08-17 01:30:51 -07:00
Jingyu Zhou 8fb6d59e94 Use error_code_grv_proxy_memory_limit_exceeded
instead of error_code_proxy_memory_limit_exceeded
2022-08-12 11:36:17 -07:00
Jingyu Zhou ed1b7ef173 Add a client knob GRV_ERROR_RETRY_DELAY 2022-08-12 11:13:32 -07:00
Jingyu Zhou 609e29f4c0 Fix backup worker to handle GRV errors 2022-08-12 11:13:32 -07:00
Yi Wu db8f00acf6 address comments 2022-08-09 19:16:28 -07:00
Yi Wu 509067016f Make encrypted mutation serialize as normal mutations 2022-08-09 19:16:26 -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
A.J. Beamon 1dc78a3b3f Add support for different transaction types (Reference<ITransaction>, Reference<ReadYourWritesTransaction>) to key backed types 2022-07-01 10:02:39 -07: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
Markus Pilman 8af056e7b0 fdbclient now compiling 2022-06-23 18:05:36 -06:00
Ray Jenkins dc9e782ccc
OpenTelemetry Tracing Perf Fixes (#6990) 2022-05-02 14:56:51 -05:00
Ray Jenkins 1c5bf135d5
Revert "Migrate to OpenTelemetry tracing. (#6855)" (#6941)
This reverts commit 5df3bac110.
2022-04-25 09:29:56 -05:00
Ray Jenkins 5df3bac110
Migrate to OpenTelemetry tracing. (#6855) 2022-04-20 09:26:37 -05:00
Dan Lambright e43fde16ec formatting 2022-04-08 17:28:16 -04:00
Dan Lambright 62975f87d1 Formatting 2022-04-08 15:04:46 -04:00
Jingyu Zhou cfcf0f152c Merge branch 'main-4a085fc84' into vv
Fix Conflicts:
	fdbclient/NativeAPI.actor.cpp
	fdbserver/ClusterRecovery.actor.cpp
	fdbserver/MasterInterface.h
	fdbserver/masterserver.actor.cpp
	flow/error_definitions.h
2022-03-30 22:28:06 -07:00