Commit Graph

1651 Commits

Author SHA1 Message Date
Hao Fu 25bc1435ef
Revert matchIndex feature (#9992)
It is not protocol compatible, revert it to avoid deployment issue.
Will have a new PR to have the feature if moving forward.
2023-04-18 20:26:26 -07:00
Zhe Wu e6bf9a8581
checkSafeExclusion should always create new ExclusionSafetyCheckRequest (#9872) 2023-04-02 10:15:56 -07:00
Sreenath Bodagala 92b0e93e01 - Do not add fdbserver processes to the client list. (#9225)
Note: Server processes started getting reported as clients since 7.1.0
(not sure if this change in behavior was intentional or not), and this
breaks the operator upgrade logic.
2023-01-27 19:51:41 +00:00
Xiaoge Su fcd4d7b29a Extract GetServerDBInfoRequest, ClientDBInfo and OpenDatabaseRequest
Wall time: 909.3
clang time: 12747.718300
2023-01-24 16:16:11 -08:00
Jingyu Zhou ce2b287b66 Revert "Make the storage metrics function tenant aware [WIP]"
This reverts commit f63934117d.
2023-01-12 16:23:26 -08:00
Jingyu Zhou e34c6a46c5 Revert "Improve the code in the actors and server, simplify the workload"
This reverts commit de90e1aab1.
2023-01-12 16:23:26 -08:00
Jingyu Zhou e10582a471 Revert "Fix bugs in finding correct shards for tenant aware storage metrics."
This reverts commit 12aaabb283.
2023-01-12 16:23:26 -08:00
Jingyu Zhou 1393d708fe Revert "Explicitly pass `arena` to the `withPrefix` function."
This reverts commit 3223208f0c.
2023-01-12 16:23:26 -08:00
Jingyu Zhou e154e657ba Revert "Clean up TraceEvents, TODOs, and simplify workload."
This reverts commit be64b12ecf.
2023-01-12 16:23:26 -08:00
Jingyu Zhou 6b12413969 Revert "Incorportate code review suggestions"
This reverts commit 854212fe94.
2023-01-12 16:23:26 -08:00
Hao Fu dfd689b416
Remove boundaryAndExist (#8994) (#9004)
* Remove boundaryAndExist

Client knows whether an entry is a boundary, and client also can
see whether the record for that entry exist by checking whether
the rangeResult is empty. This field is useless.

This field breaks backward compatibility, need to remove it.
2022-12-15 14:14:39 -08:00
Jingyu Zhou 598fb72fb2 Fix assertion failure from changeFeedTSSValidator() 2022-12-10 10:01:06 -08:00
sfc-gh-tclinkenbeard 2d9eb7f38a Fix clang 15 compiler warnings 2022-12-09 10:01:14 -08:00
FoundationDB CI 091b43b3e3
format source code after switch to clang 15 2022-12-08 17:32:51 +00:00
Xiaoge Su f7e512b1c1 fixup! Remove comments 2022-12-05 13:37:59 -08:00
Xiaoge Su 55492d07ff fixup! Reformat source 2022-12-05 13:37:52 -08:00
Xiaoge Su 8a273f964e fixup! Update code per comments 2022-12-05 13:37:47 -08:00
Xiaoge Su 29224d4cef Remove cx->clearWatchMetadata() when connection file changed
In NativeAPI.actor.cpp, ::watch ACTOR will call cx->clearWatchMetadata()
when the connectionFileChanged event is triggered. After that, it will
create a new watch metadata for itself.

If there are multiple watches, each of them that receives the
cnnectionFileChanged will clear *all* watch data and create *one* watch
for itself. This does not makes sense. A watch should only clear the
metadata, and then create one, for itself.

cx->clearWatchMetadata() is only used there, thus removed.
2022-12-05 13:37:43 -08:00
Xiaoge Su b0c5fa6a44 Update fdbclient/NativeAPI.actor.cpp
Co-authored-by: Jingyu Zhou <jingyuzhou@gmail.com>
2022-12-05 13:37:18 -08:00
Xiaoge Su 534bd807da Remove debugging output 2022-12-05 13:37:13 -08:00
Xiaoge Su 6c4a8b25a9 Record the version of each watch
In the case
    1. A watch to key A is set, the watchValueMap ACTOR, noted as X, starts waiting.
    2. All watches are cleared due to connection string change.
    3. The watch to key A is restarted with watchValueMap ACTOR Y.
    4. X receives the cancel exception, and tries to dereference the counter. This causes Y gets cancelled.

the reference count will cause watch prematurely terminate. Recording
the versions of each watch would help preventing this issue
2022-12-05 13:36:48 -08:00
Xiaoge Su 3abf4661b9 Cancel watch when the key is not being waited
Currently, there is a cyclic reference situation in

    DatabaseContext -> WatchMetadata -> watchStorageServerResp ->
    DatabaseContext

If there is a watch created in the DatabaseContext, even the
corresponding wait ACTOR is cancelled, the WatchMetadata will still hold
a reference to watchStorageServerResp ACTOR, which holds a reference to
DatabaseContext.

In this situation, any DatabaseContext who held a watch will not be
automatically destructed since its reference count will never reduce to
0 until the watch value is changed. Every time the cluster recoveries,
several watches are created, and when the cluster restarts, the
DatabaseContext which not being used, will not be able to destructed due
to these watches.

With this patch, each wait to the watch will be counted. Either the
watch is triggered or cancelled, the corresponding count will be
reduced. If a watch is not being waited, the watch will be cancelled,
effectively reduce the reference count of DatabaseContext. This will
hopefully fix the issue mentioned above.

The code is tested by 1) Manually change the number of logs of a local
cluster, see the cluster recovery and previous DatabaseContext being
destructed; 2) 100K joshua run, with 1 failure, the same test will fail
on the current git main branch.
2022-12-05 13:36:38 -08:00
A.J. Beamon 52051de95b In try commit, wait for the read version future before waiting for the commit cost estimate. This allows us to give precedence to the database_locked error over errors thrown by the commit cost estimation. 2022-11-18 09:18:05 -08:00
Hao Fu 62970b374d
add bytelimit for prefetch (#8768) (#8798)
* add bytelimit for prefetch

A fraction of byteLimit will be used as the limit to fetch index.
For the indexes fetched, fetch records for them in batch.

byteLimit always count the index size, it also count record if exist,
it at least return 1 index-record entry and always include the last entry
despite that adding the last entry despite it might exceed limit.

There is a Knob STRICTLY_ENFORCE_BYTE_LIMIT, when it is set, records
will be discarded once the byteLimit is hit, despite they are fetched.
Otherwise, return the whole batch.
2022-11-11 22:52:17 -08:00
Josh Slocum 89519343a7
adding new bg read metrics to client and refactoring them into a new trace event (#8493) 2022-10-18 14:13:35 -05:00
Jingyu Zhou 1b2fcdd4f6
Merge pull request #8053 from sfc-gh-akejriwal/getsizetenant
Make the storage metrics functions tenant aware
2022-10-17 20:02:52 -07:00
Dennis Zhou 1c90fbbc61 blob: tenant verifyBlobRange() native api 2022-10-17 11:42:08 -05:00
Dennis Zhou 4a33de31e9 blob: tenant listBlobbifiedRanges() native api 2022-10-17 11:41:45 -05:00
Dennis Zhou 120b38a926 blob: tenant (un)blobbify() native api 2022-10-17 11:41:12 -05:00
Dennis Zhou 0ee0ce62f0 blob: blobGranuleGetTenantEntry() for tenant and database calls
Currently, blobGranuleGetTenantEntry() expects to get the TenantName
through the transaction. Database calls cannot abide by this contract.
So enable the call to take in a TenantName and expect at least 1 to be
set.
2022-10-17 11:41:12 -05:00
Ankita Kejriwal 0f9da9d1ad Merge branch 'main' of github.com:apple/foundationdb into getsizetenant 2022-10-14 16:50:51 -07:00
Ankita Kejriwal 854212fe94 Incorportate code review suggestions 2022-10-13 17:41:31 -07:00
Ankita Kejriwal be64b12ecf Clean up TraceEvents, TODOs, and simplify workload. 2022-10-13 14:31:42 -07:00
Jingyu Zhou df5825ff65
Merge pull request #8398 from sfc-gh-anoyes/anoyes/idempotency-id2
Initial work for automatic idempotency
2022-10-13 13:07:14 -07:00
Josh Slocum 96574bacaa
Change Feed TSS Support (#8384)
* Change Feed TSS Support

* bug fixing for rare mismatch cases

* Adding rollback handling to tss change feed comparison
2022-10-12 10:23:51 -05:00
Ankita Kejriwal 3223208f0c Explicitly pass `arena` to the `withPrefix` function.
Also update some TraceEvents to be more succinct.
2022-10-11 18:35:01 -07:00
Andrew Noyes aad3899cb7 Enforce the lifetime of a write tx is actually <= MAX_WRITE_TRANSACTION_LIFE_VERSIONS 2022-10-11 13:46:39 -07:00
Andrew Noyes 045452aec8 Add more detail to TraceEvents 2022-10-11 13:46:39 -07:00
Andrew Noyes 6ef8d7ec95 Add AutomaticIdempotencyWorkload 2022-10-11 13:46:39 -07:00
Andrew Noyes f48d0d929b Assign to idempotency id through transaction options 2022-10-11 13:46:39 -07:00
Ankita Kejriwal 11658c7135 Merge branch 'main' of github.com:apple/foundationdb into getsizetenant 2022-10-11 13:09:47 -07:00
Ankita Kejriwal 12aaabb283 Fix bugs in finding correct shards for tenant aware storage metrics.
* Account for tenant in during cache invalidation in NativeAPI actor.
* Account for tenant prefix while checking whether a shard is readable
  on storage server.

This commit also adds many debug TraceEvents that will later be
removed.
2022-10-10 18:52:03 -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
A.J. Beamon f8186988bc
Merge pull request #8378 from sfc-gh-ajbeamon/tenant-support-for-database-switching
Add tenant support for database switching
2022-10-05 14:57:33 -07:00
Sreenath Bodagala e83229ed8b
- Version vector specific: Propagate the latest commit version, as (#8393)
part of the read request, when reading from a storage server.
2022-10-05 16:23:56 -04:00
Josh Slocum dc917453c1
Targeted blob granules fault injection (#8231) 2022-10-05 13:44:38 -05:00
A.J. Beamon 53593c77ac When updating watches after a database switch, lookup the tenant again to get the ID on the new cluster. Update the switching test to set up tenants properly. 2022-10-03 09:24:13 -07:00
Ankita Kejriwal de90e1aab1 Improve the code in the actors and server, simplify the workload 2022-09-29 18:34:35 -07:00
Ankita Kejriwal f63934117d Make the storage metrics function tenant aware [WIP]
This change makes the getEstimatedRangeSizeBytes function tenant aware.
Previously, this function would return the size of the requested
keyspace even if the tenant in the Transaction or DatabaseContext did
not match the tenant corresponding to the keyspace.

Also make some improvements to the new workload.
2022-09-29 18:32:04 -07:00
A.J. Beamon c8bb15e8ee
Merge pull request #8216 from sfc-gh-ajbeamon/backup-support-for-tenants
Include tenant and metacluster metadata in backups
2022-09-28 12:00:24 -07:00