Commit Graph

982 Commits

Author SHA1 Message Date
Zhe Wang 432c077b51
fix dd issue when dd skip audit (#10844) 2023-08-28 16:39:45 -07:00
Jingyu Zhou 1a6114a66f
Merge pull request #10843 from xis19/main
fixup! Add back missing initializer
2023-08-28 12:51:54 -07:00
Xiaoge Su d0685f9fff fixup! Add back missing initializer 2023-08-28 11:05:07 -07:00
Zhe Wang f43b20e15c
Audit location metadata in DD (#10820)
* Audit location metadata in DD

* nits
2023-08-25 17:11:11 -07:00
Xiaoge Su d8d9b9402b fixup! Subobject-linkage
/codebuild/output/src3651401136/src/github.com/apple/foundationdb/fdbserver/DataDistribution.actor.cpp:111:8: error: 'DDAudit' has a field 'DDAudit::context' whose type uses the anonymous namespace [-Werror=subobject-linkage]
2023-08-23 13:47:41 -07:00
Xiaoge Su 26a87da578 fixup! Use isMocked method 2023-08-23 13:25:37 -07:00
Xiaoge Su 1ec5ed13b9
Merge branch 'main' into main 2023-08-23 11:35:21 -07:00
Zhe Wang 7e8f326277
Audit storage for specific engine (#10781)
* audit storage for specific engine

* fix getStorageType

* fix budget of skipAuditOnRange

* fix budget in scheduleAuditOnRange

* fix CI error

* improve trace events

* address comments
2023-08-23 10:51:24 -07:00
Xiaoge Su ac2bf66a2a fixup! gcc does not allow class member variable uses anonymous namespace
fdbserver/DataDistribution.actor.cpp:360:8: error: 'DataDistributor' has a field 'DataDistributor::audits' whose type uses the anonymous namespace [-Werror=subobject-linkage]

clang does not report the same error
2023-08-22 18:03:46 -07:00
Xiaoge Su 130102f1bd Disable AuditService when mocking DD 2023-08-22 15:51:38 -07:00
Zhe Wang f1c17b27fc
Multiple improvements to AuditStorages (#10685)
* remove danger DDAudit assert, add AuditRate knob, add progress check when ssshard complete, add progress check for ssshard in fdbcli

* throttle progress check for ssshard

* fix getAuditProgressByServer

* fix trace event for ss audit

* using name -- checkMoveKeysLockForAudit

* new scheduleAuditLocationMetadata

* address comments

* shorten progress summary for ssshard

* simplify getAuditProgressByServer in fdbcli
2023-08-14 13:13:49 -07:00
Zhe Wu 726574243c Improve PerpetualWiggleStorageMigration reliability 2023-08-10 09:36:04 -07:00
Zhe Wang 3426fc3c1a
Add DD Security Mode (#10646)
* dd-security-mode

* address comments

* cleanup

* revise tr option set in loadAndUpdateAuditMetadataWithNewDDId

* address comments

* reset auditStorageInitStarted before DD init

* decouple audit resume and audit launch

* audit launch new request should wait for resuming existing requests

* address comment/clean up/fix

* fix

* fix initAuditMetadata retry

* fix initAuditMetadata retry should reset tr
2023-07-21 17:06:25 -07:00
Zhe Wang 522c9d4f0f
Add new implementation of audit storage for user data (#10613)
* remainingBudgetForAuditTasks should be managed within audit

* fix CI

* add audit storage test for various ranges

* clean DD

* new auditStorageUserDataQ

* fix assert fail in startTrackShardAssignment

* fix assert fail in ssaudit

* address comments

* replace assert with audit_cancel in ss audits

* add audit check progress tool

* add observability to audit progress and fix audit bugs

* fix audit progress issues and add sim test for audit progress and add trace event for the audit progress and add fdbcli to track the audit progress

* remove old audit storage on SS

* check audit progress when auditCore completes
2023-07-16 09:56:26 -07:00
He Liu 6337125712
Several minor improvements for ShardedRocksDB (#10520)
* Terminate DD if SHARD_ENCODE_LOCATION_METADATA is not enabled and storage_engine_type is ShardedRocksDB.

* Fixed Error in non-main thread.

* Minor improvements.
2023-06-24 16:07:14 -07:00
Evan Tschannen ef682d304e fix IKeyValueStore include 2023-06-16 13:28:40 -07:00
Evan Tschannen 74614161b2
Merge pull request #10460 from sfc-gh-etschannen/feature-durable-change-feed
Cache change feeds durably on blob workers
2023-06-14 08:35:52 -07:00
He Liu c286c9ca3e
Fixed Iterator Pool `reset` issue & Improve psm test (#10462)
* Cancel a data move if the source or dest server lists are modified.

* error_.

* Enabled DD ealier.

* fixed iterator pool `reset` error.

* fmt.
2023-06-13 12:06:20 -07:00
Evan Tschannen 359e178dcd Merge branch 'main' into feature-durable-change-feed
# Conflicts:
#	fdbclient/ClientKnobs.cpp
#	fdbserver/BlobManager.actor.cpp
#	fdbserver/worker.actor.cpp
2023-06-11 13:58:35 -07:00
He Liu cb3450b51a
Cancel a data move if the source or dest server lists are modified. (#10425)
* Cancel a data move if the source or dest server lists are modified.

* fmt.
2023-06-08 15:30:52 -07:00
Zhe Wang 8119e3da87
Fix audit storage actor cancel issue (#10443)
* init

* add testAuditStorageConcurrentRunForSameType test
2023-06-08 09:53:32 -07:00
Xiaoxi Wang 6afd585a3c Address review: mock assertion and shard number condition 2023-06-07 22:01:33 -07:00
Xiaoxi Wang b444eb1f22 Make DataDistributor use the configuration object in DDSharedContext; Change Mock test config 2023-06-07 22:01:33 -07:00
Xiaoxi Wang ac16dbd0d8 Fix mock DD incompatible places 2023-06-07 22:01:33 -07:00
Xiaoxi Wang bef639ab81 change how MockDataDistributor start 2023-06-07 22:01:33 -07:00
Xiaoxi Wang 93cc993e86 Change DDSharedContext members 2023-06-07 22:01:33 -07:00
Xiaoxi Wang 1db0e83eff Add MockDataDistributor.h 2023-06-07 22:01:33 -07:00
Xiaoxi Wang cf60c8f567 make dataDistributor actor compatible with mock test 2023-06-07 22:01:33 -07:00
Zhe Wang f8f8f72c4e
Add audit storage cancellation (#10386)
* list audits

* cancel audits and corresponding tests

* make audit storage dblock aware

* increase audit retry since we are able to cancel

* fix updateAuditState and fdb github ci

* fmt

* fix fdbcli audit_storage and fix CI issue

* fix fdb cli

* address comments

* fmt
2023-06-06 14:29:53 -07:00
He Liu 883761e8e4
Delete a data move if key range is not consistent. (#10334) 2023-06-01 19:14:36 -07:00
Zhe Wang 61aaca005e
SS Audit Storage Throttling (#10322)
* ss audit storage throttling

* add audit manager to ss

* reduce CONCURRENT_AUDIT_TASK_COUNT_MAX

* revises comments

* fix audit cli

* fix getAuditStates

* remove toStringForCLI
2023-05-29 14:43:47 -07:00
Zhe Wang 53675db306
Fix audit storage issue with multiple DDs (#10310)
* init

* add DDAuditContext

* move metadata update before runauditstorage

* revert DDAuditContext and replace ddAuditId with ddId

* cleanup
2023-05-26 15:56:03 -07:00
Zhe Wang 6c980862c3
Improve throughput of audit storage (#10245)
* improve audit throughput

* if ssshard fails do audit due to ssi failure, then global retry is required

* fix a trace event name

* fix budget release in doAudit

* avoid throttling in general simultion tests

* fix doAuditOnStorageServer throw error

* avoid starting a task that has been complete

* when ddaudit ssshard failed, check if ssi is removed, if yes, silently exit

* fix trace detail name of AuditUtilStorageServerRemovedEnd evenrt

* redo schedule in doAuditOnStorageServer

* schedule does not wait doAudit

* remove TESTING_AUDIT_STORAGE_THROTTLING

* ssaudit stops proceeding if ddauditstate is not in running phase

* make tester audit storage only happen when simulation, and randomly set CONCURRENT_AUDIT_TASK_COUNT_MAX
2023-05-22 12:09:08 -07:00
Zhe Wang 852e012eb2
Adding throttling of audit storage tasks and tracing progress of tasks (#10233)
* when trigger doAuditOnStorageServer, check remainingBudgetForAuditTasks

* add trace event of audit progress

* address comments

* code clean up

* make dispatch and schedule audit be more clear

* make dispatch and schedule audit be more clear 2

* make dispatch and schedule audit be more clear 3

* address comments
2023-05-15 16:19:41 -07:00
Zhe Wang 8559d4f1a8
Adding cleanup of old audit metadata (#10137)
* clean up old audit metadata

* change comments

* fix audit cleanup rule as PR description claim and reduce timeout of auditStorageCorrectness in tester

* address comment

* clear audit metadata should not throw error

* cleanup progress metadata by type

* control number of AuditStatistic events

* carefully persist new audit state

* add unit tests and fix issues

* cleanup

* allow audit concurrent run for different types and fix some bug in auditutl

* fix ci issue and nits
2023-05-10 19:32:04 -07:00
Evan Tschannen 3dd86d6c22 move IKeyValueStore.h to the client 2023-05-10 15:41:47 -07:00
Chaoguang Lin 50df914c80
Add snapshot restarting tests back to correctness on main (#10164)
* Enable fault injection;
Ignore MAX_COORDINATOR_SNAPSHOT_FAULT_TOLERANCE in simulation
Fix the issue when there's not fdb.cluster file and disable randomMoveKeys in SnapTest workload

* Move snap tests to from_7.3.0

* Add comments for the change

* Change SevError to SevWarn when Tlog process is not found in the worker map
2023-05-09 11:02:27 -07:00
Evan Tschannen c8e8505101
buggified max_shards_on_large_teams (#10105)
* buggified max_shards_on_large_teams, and had the consistency scan verify the proper number of shards have been overreplicated

* fix: when restarting the data distributor, do no allow more than max_shards_on_large_teams shards to be marked as healthy
2023-05-08 16:56:42 -07:00
Zhe Wang d254fba6e5
Adding cleanup of audit progress metadata when audit complete (#10118)
* cleanup audit progress metadata and tester directly issue audit requests to DD instead of CC

* address comments and fix test dd issue request but dd not present
2023-05-03 15:39:22 -07:00
Xiaoxi Wang 91de1c880e remove PrepareBlobRestore waiting for inFlight moving 2023-05-03 14:43:23 -07:00
Xiaoxi Wang f6da0480fc add comments to DDEnabledState and rename some methods 2023-05-02 09:40:11 -07:00
Xiaoxi Wang a958436bf5 force blob migrator's ssi to be undesired; remove TCServerInfo from prepareBlobMigrator parameter list 2023-05-02 09:40:11 -07:00
Xiaoxi Wang fdc576a938 force blob migrator's ssi to be undesired 2023-05-02 09:40:11 -07:00
Xiaoxi Wang f33a5a5f91 Remove unused function and rename some method 2023-05-02 09:40:11 -07:00
Xiaoxi Wang 880274ab48 add PrepareBlobRestoreRequest, and make DD handle the BlobRestore
prepare transactions

add DD Restore Preparing state; actor accept blob migrator requests

Refactor DDEnabledState and PrepareBlobRestoreReply

Improve the initialization, remove unused DDSharedContext method

move prepareBlobRestore to moveKeys

Make context->lock and DataDistributor.lock share the reference; change checkMoveKeysLock to checkPersistenMoveKeysLock; Add more debug trace

fix requestId assignment bug

Add DDEnabledState::sameId method

Throw movekeys_conflict after hybrid restore preparation to force reload
server list and shard mapping; format code; remove unused
methods,definition and comments

fix rebase conflicts

Make DD only load initial Data Distribution after enabled

use dd_config_changed error and throw it in serveBlobMigratorRequests

move empty range check before blob restore to the transaction lock database

Rename BlobRestore*
2023-05-02 09:40:11 -07:00
Zhe Wang d6e7b5f736
Audit storage: validate consistency of replica and shard location metadata (#9628)
* Implemented AuditUtils.actor.cpp

Moved AuditUtils to fdbserver/

* Persist AuditStorageState.

* Passed persisted AuditStorageState test.

* Added audit_storage_error to indicate a corruption is caught.

Throw/Send audit_storage_error when there is a data corruption.

Added doAuditStorage() for resuming Audit.

* Load and resume AuditStorage when DD restarts.

* Generate audit id monotonically.

* Fixed minor issue AuditId/Type was not set.

* Adding getLatestAuditStates.

* Improved persisted errors and added AuditStorageCommand.actor.cpp for
fdbcli.

* Added `audit_storage` fdbcli command.

* fmt.

* Fixed null shared_ptr issue.

* Improve audit data.

* Change DDAuditFailed to SevWarn.

* Sev.

* set SERVE_AUDIT_STORAGE_PARALLELISM to 1.

* Moved AuditUtils* to fdbclient/.

* Added getAuditStatus fdbcli command.

* Refactor audit storage fdb cli commands.

* Added auditStorage in sim.

* Cleanup.

* Resolved comments.

* Resolved comments.

* Added SystemData for metadata audit.

Refactored audit workflow to make sure all sub-tasks are executed w/o
early exit.

* Improvements.

* Persisted Failed state after too many retries.

* Added retryCount for resumeAuditStorage().

* resolving conflict.

* Resolved conflicts.

* allow-merged-to-run

* add timeout to audit client

* fmt

* validate replica

* add audit serverKey

* address comments and fmt

* fix audit_storage_exceeded_request_limit

* fix segfault in getLatestAuditStatesImpl

* fix bugs

* remove timeout from workload

* fix bugs

* audit local view of shard assignment

* fmt

* fix-stuck-issue-and-make-dd-audit-storage-self-retry

* fix timeout

* fix timeout

* fix bugs and cleanup

* fix nit

* change name state to coreState for audit metadata

* address comments

* code clean

* fmt

* setup debug

* cleanup

* clean up

* code cleanup

* code clean

* remove tmp file

* fmt

* trace portion of shards that of anonymous physical shard

* remove unnecessary actor cleanup

* do not give up when tr is too old

* address commits

* refactor

* clean

* fmt

* fix-command-help-text

* fix-auditstate-restore-and-enable-restore-to-metadata-audit

* address comments

* fmrt

* debug and improve efficient of resume audit

* small change

* fix audit cli

* bypass completed audit when dd restart

* fix auditStorageCommandActor

* make mismatch key range more visable

* address comments

* make local shard metadata check can make progress by retries

* address comments

* address comments

* partition location metadata validation by range and server

* unset MIN_TRACE_SEVERITY

* address comments and SS auto proceed until failed then notify dd

* persistNewAuditState should checkMoveKeysLock

* audit storage location metadata partitioned by range and move shard assignment history def to the end of SS structure

* code cleanup

* fix error message in metadata validation

* fix registerAuditsForShardAssignmentHistoryCollection input for local shard validation

* add comments to code and add guard to make sure the SS audit does not proceeds automatically for many times without being notified by DD --- to support audit cancellation later

* fix coalesceRangeList

* replace rangeOverlapping func with operator and use struct instead of complicated type for return value of getKeyServer/serverKey/shardInfo

* simplify shard assignment history

* shardAssignmentRecordRequests should be unorder_map

* address comments, make trackShardAssignment simple, make anyChildAuditFailed cover all audit children, keep only one audit actor run at a time on each SS

* only run validate shard info once at a time, other audit type does not have this limitation

---------

Co-authored-by: He Liu <heliu05023@gmail.com>
Co-authored-by: He Liu <heliu@apple.com>
Co-authored-by: Zhe Wang <zhewang@Zhes-Laptop.local>
2023-05-01 10:35:52 -07:00
Steve Atherton 7f6d5f296a Merge commit 'e318fc260070ba6ba604930b8f259c9b655938ea' into keybackedrangemap
# Conflicts:
#	flow/include/flow/error_definitions.h
2023-04-25 14:21:23 -07:00
Chaoguang Lin e318fc2600
Fix for correctness failures when issuing duplicate snapshot requests (#10041)
* Fix for correctness failures when issuing duplicate requests
Add comments; Disable failure injection in Snap test

* Format files
2023-04-25 13:48:50 -07:00
Steve Atherton 858b51a69b Address review comments. KeyRangeMapSnapshot is now ReferenceCounted and getSnapshot() returns a Reference to discourage copying. Added several comments for clarity. Added FormatUsingTraceable and changed all new formatters to use it except for Standalone<T> which redirects to the formatter for T. 2023-04-24 19:01:05 -07:00
Steve Atherton c57ed25987 Renamed SystemDBLockWriteNow() to SystemDBWriteLockedNow() and changed definition to be more direct / clear. 2023-04-22 13:17:41 -07:00