Commit Graph

389 Commits

Author SHA1 Message Date
sfc-gh-tclinkenbeard 986c792a9f Drop UDP packets more frequently in simulation 2023-01-15 17:32:57 -08:00
Kevin Hoxha 407c371635 metrics: Add simulation testing and fix incorrect TraceEvent names
- Added a background actor that listens on METRICS_EMISSION_UDP_PORT for incoming metrics (and verifies they are in the correct format)
- TraceEvent details have certain requirements for naming. This commit makes a seperate name for Counter/LatencySample and its underlying IMetric to avoid
those issues
2022-12-08 10:07:11 -08:00
Hui Liu 891331caed
Merge pull request #8881 from sfc-gh-huliu/fixinit
Init blobGranulesEnabled in ISimulator
2022-11-18 17:07:57 -08:00
Hui Liu bee0377b4d Init blobGranulesEnabled in ISimulator 2022-11-18 15:53:06 -08:00
Junhyun Shim bfefbfee8c
Merge pull request #8705 from sfc-gh-jshim/authz-accept-base64-for-jwt-tenant-name
Make token's 'tenants' field base64-encoded (cf. base64url)
2022-11-16 10:17:10 +01:00
Markus Pilman 503769ef05
Merge pull request #8496 from sfc-gh-mpilman/bugfixes/machines-attrition-debugging
Enable machine attrition injection
2022-11-15 16:32:33 -07:00
Junhyun Shim 41ea1678d0 Merge remote-tracking branch 'origin/main' into authz-accept-base64-for-jwt-tenant-name 2022-11-15 22:57:49 +01:00
sfc-gh-tclinkenbeard c03f60c618 Update rare code probe annotations 2022-11-15 13:21:25 -08:00
Markus Pilman f105cb1809 Merge remote-tracking branch 'origin/main' into bugfixes/machines-attrition-debugging 2022-11-14 10:11:52 -07:00
Markus Pilman 40c1bbc49a Fix gcc problem with typenames 2022-11-09 10:14:13 -07:00
Markus Pilman 6643ed0a26 fix print-sim-time 2022-11-08 12:19:39 -07:00
Junhyun Shim 112363ef14 Merge remote-tracking branch 'origin/main' into authz-accept-base64-for-jwt-tenant-name 2022-11-08 13:16:08 +01:00
Junhyun Shim 50f4021cf7 Make token's 'tenants' field base64-encoded (cf. base64url)
- Remove redundant operation from TokenSign
- Let the sign/verify API directly report errors
  instead of tracing at failing subroutine, which lacks context
2022-11-04 20:17:08 +01:00
Josh Slocum cff99a64f6
Blob Granule Attrition fixes (#8682)
* Assert was incorrect in change feed destroy race with moved() clearing map

* fixing race between injected fault and granule revoke

* Handling race in sim2 blob worker attrition check
2022-11-03 18:48:10 -05:00
Markus Pilman f1fea14255 Merge remote-tracking branch 'origin/main' into bugfixes/machines-attrition-debugging 2022-11-01 13:51:35 -06:00
Lukas Joswiak 5ca2b89bdf Fix simulation issue where process switch was ignored
The simulator tracks only active processes. Rebooted or killed processes
are removed from the list of processes, and only get added back when the
process is rebooted and starts up again. This causes a problem for the
`RebootProcessAndSwitch` kill type, which wants to simultaneously reboot
all machines in a cluster and change their cluster file. If a machine is
currently being rebooted, it will miss the reboot process and switch
command.

The fix is to add a check when a process is being started in simulation.
If the process has had its cluster file changed and the cluster is in a
state where all processes should have had their cluster files reverted
to the original value, the simulator will now send a
`RebootProcessAndSwitch` signal right when the process is started. This
will cause an extra reboot, but should correctly switch the process back
to its original, correct cluster file, allowing the cluster to fully
recover all clusters.

Note that the above issue should only affect simulation, due to how the
simulator tracks processes and handles kill signals.

This commit also adds a field to each process struct to determine
whether the process is being run in a DR cluster in the simulation run.
This is needed because simulation does not differentiate between
processes in different clusters (other than by the IP), and some
processes needed to switch clusters and some simply needed to be
rebooted.
2022-10-27 13:56:13 -07:00
Lukas Joswiak f43011e4b7 Notify processes joining the wrong cluster
And have these processes enter a "zombie" state where they cancel all
their actors and then wait forever, refusing to do any additional work
until they are manually handled by the operator.
2022-10-27 13:56:13 -07:00
Lukas Joswiak a72066be33 Add simulation support for changing the cluster file 2022-10-27 13:56:13 -07:00
Markus Pilman 3c943ac37a fix merge bugs 2022-10-26 10:42:11 -06:00
Markus Pilman e7b5b870a3 Merge remote-tracking branch 'origin/main' into bugfixes/machines-attrition-debugging 2022-10-24 15:24:36 -06:00
Markus Pilman 2310584a05 Merge remote-tracking branch 'sfc/bugfixes/machines-attrition-debugging' into bugfixes/machines-attrition-debugging 2022-10-24 15:01:03 -06:00
Markus Pilman 43cafb0bc2 Track disk corruptions and mark resulting failures as injected 2022-10-24 14:54:43 -06:00
Andrew Noyes fb9333e863 Delete Sim2::PromiseTask
Previously this was leaking and causing simulation OOM's. Also make it
FastAllocated to match Net2::PromiseTask
2022-10-24 09:25:21 -07:00
Jingyu Zhou a8391caf23 Revert "Data loss protection v2" 2022-10-20 18:09:58 -05:00
Lukas Joswiak 165f4266b8 Avoid passing processes from multiple clusters to `canKillProcesses`
Previously, `canKillProcesses` was being called with processes from both
the main and DR clusters. This would cause it to incorrectly allow
permanent killing of machines, as it was acting on bad data.
2022-10-19 16:56:08 -07:00
Lukas Joswiak 7f889c87e3 Fix simulation issue where process switch was ignored
The simulator tracks only active processes. Rebooted or killed processes
are removed from the list of processes, and only get added back when the
process is rebooted and starts up again. This causes a problem for the
`RebootProcessAndSwitch` kill type, which wants to simultaneously reboot
all machines in a cluster and change their cluster file. If a machine is
currently being rebooted, it will miss the reboot process and switch
command.

The fix is to add a check when a process is being started in simulation.
If the process has had its cluster file changed and the cluster is in a
state where all processes should have had their cluster files reverted
to the original value, the simulator will now send a
`RebootProcessAndSwitch` signal right when the process is started. This
will cause an extra reboot, but should correctly switch the process back
to its original, correct cluster file, allowing the cluster to fully
recover all clusters.

Note that the above issue should only affect simulation, due to how the
simulator tracks processes and handles kill signals.

This commit also adds a field to each process struct to determine
whether the process is being run in a DR cluster in the simulation run.
This is needed because simulation does not differentiate between
processes in different clusters (other than by the IP), and some
processes needed to switch clusters and some simply needed to be
rebooted.
2022-10-18 21:37:42 -07:00
Lukas Joswiak 743609f217 Notify processes joining the wrong cluster
And have these processes enter a "zombie" state where they cancel all
their actors and then wait forever, refusing to do any additional work
until they are manually handled by the operator.
2022-10-18 21:37:40 -07:00
Lukas Joswiak 43854c5ac8 Add simulation support for changing the cluster file 2022-10-18 21:37:16 -07:00
Marian Dvorsky c6c449d047
Extract TaskQueue out of Net2 and reuse it in sim2 (#8330)
* Extract TaskQueue out of Net2 and reuse it in sim2

* empty commit

* Address review comments

* Introduce MAX_RUNLOOP_SLEEP_DELAY

* Apply clang-format
2022-10-10 12:46:06 -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
Hui Liu 05a0a3a9c8 Fix trace event error 2022-09-30 15:55:43 -07:00
Hui Liu 9db48eb10c fix killMachine - make sure we have at least 1 blob worker in a dc 2022-09-30 11:18:27 -07:00
sfc-gh-tclinkenbeard 985958c260 Add rare code probe decoration 2022-09-25 15:28:32 -07:00
Dan Adkins c5366e1116 sim: don't allow calls to killProcess or killInterface to kill protected processes.
killProcess_internal assumes that we've already checked and won't attempt to kill
a protected process. It's up to killProcess and killInterface, which are invoked
externally from simulated workloads, to enforce that constraint.
2022-09-21 13:05:56 -07:00
A.J. Beamon 4fd64630e8 Convert literal string ref instances to use _sr suffix 2022-09-19 11:35:58 -07:00
sfc-gh-tclinkenbeard 82adc1e856 Make g_simulator a pointer 2022-09-15 09:00:33 -07:00
Lukas Joswiak d6b25d6ce8 Initialize configuration database type in simulator 2022-09-14 14:14:49 -07:00
Junhyun Shim 94866d54d0 Merge remote-tracking branch 'origin/main' into authz-general-tls-and-integration-test 2022-08-23 18:07:49 +02:00
Hui Liu 33411fd07e
add an option to read from blob storage for moving keys (#7848) 2022-08-23 08:07:17 -05:00
Junhyun Shim 1dbb13a899 Accept non-mTLS clients as untrusted 2022-07-28 20:03:07 +02:00
Junhyun Shim e2a3fedfc7
Merge branch 'main' into features/authz 2022-07-27 00:08:57 +02:00
Renxuan Wang dc9599f2e9
Get network interfaces ready for https proxy. (#7556)
* Move HTTP from fdbclient/ to fdbrpc/.

* Move md5 and libb64 to contrib/.

* Get network interfaces ready for https proxy.

* Rebase
2022-07-25 17:08:32 -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 2edbcf2c65
Merge pull request #44 from apple/main
Merge main
2022-07-12 07:51:22 -06:00
Markus Pilman 5a880fd15e Create keys when running simulation 2022-07-07 11:24:45 -06:00
Xiaoxi Wang 0054b8a754 Merge branch 'main' of https://github.com/apple/foundationdb into bug/remotekv 2022-06-28 23:41:25 -07:00
Xiaoxi Wang c6ff556f06 fix bug by exclude the spawned kv process info when counting dead process; add method 2022-06-28 23:39:22 -07:00
Markus Pilman 03d913a1de Flow compiling 2022-06-27 17:05:55 -06:00
Markus Pilman 38e100ebc5 flow bindings are compiling 2022-06-23 19:06:05 -06:00
Markus Pilman de48e90276 fdbserver is now compiling 2022-06-23 18:45:26 -06:00