Commit Graph

115 Commits

Author SHA1 Message Date
Meng Xu 36ad1a95f4 Resolve conflicts when merge release-6.3 into master 2020-05-25 12:11:59 -07:00
Meng Xu 1c35ad884f Merge branch 'master' into mengxu/release-6.3-conflict-PR
Has conflict with master;
Next commit will fix the conflicts.
2020-05-25 12:01:49 -07:00
A.J. Beamon d128252e90 Merge release-6.3 into master 2020-05-22 09:25:32 -07:00
Jingyu Zhou 9e23166cf8 Fix a super rare missing mutation bug in backup workers
When a backup worker stops pulling for an old epoch, we cannot clear mutations.
This is because these muations are needed for saving.
2020-05-21 12:19:57 -07:00
Jingyu Zhou cdeabc4de6 Fix memory accounting error due to growing Arena
After an Arena object is counted, it can grow larger later. So we can't reduce
the amount of memory of arena size later. Instead, we use the arena size when
inserting mutations.
2020-05-20 13:26:57 -07:00
Jingyu Zhou 9fbbec1033 Fix duplicated counting of memory usage
For each message from LogPeekCursor, check it's using different arena from the
previous one. Otherwise, the arena's memory could be counted twice.
2020-05-16 18:50:09 -07:00
Jingyu Zhou a2e5050492 Fix duplicated mutation
This seems to be related to how actor compiler generates code. The message can
be inserted twice with original code ordering.
2020-05-16 10:52:11 -07:00
Jingyu Zhou caca31d05a Filter out mutations before the true-up version
When a mutation log's begin version is true-uped, we must filter out mutations
less than such a version.
2020-05-15 20:06:47 -07:00
Jingyu Zhou 01eff0fc03 Fix memory bytes accounting
Avoid duplicated counting of arena memory since messages from peek cursor can
share arena.
2020-05-14 19:59:54 -07:00
Jingyu Zhou 17915e13b0 Limit memory usage of backup workers 2020-05-14 13:24:56 -07:00
Jingyu Zhou 1a35efe43c Add an assertion: mutation version >= log's begin version
This is to check that no version's data are split into two files.
2020-05-14 12:06:13 -07:00
Alex Miller ccaac162e2 Resolve performance concerns of nearly-no-op debugMutation being frequently called
This introduces unhygenic macro variants that inline a `ENABLED &&`
before the TraceEvent.  This way, they get entirely compiled out unless
enabled.

Then rewrite all debugMutation uses via sed.
2020-05-13 18:44:15 -07:00
Alex Miller 27da91ab9e Merge remote-tracking branch 'upstream/master' into mutation-debugging 2020-05-13 12:51:44 -07:00
A.J. Beamon 36454bb3b8 Merge branch 'master' into transaction-tagging
# Conflicts:
#	fdbclient/MasterProxyInterface.h
#	fdbclient/NativeAPI.actor.cpp
2020-05-04 10:23:25 -07:00
Evan Tschannen bd699f435c fixed compiler errors 2020-05-01 11:01:09 -07:00
A.J. Beamon 66228343f1 Merge branch 'master' into transaction-tagging 2020-04-30 08:12:03 -07:00
Jingyu Zhou 7d59e53349 Consolidate makePadding() 2020-04-28 15:39:23 -07:00
A.J. Beamon 41c517a5dd Merge branch 'master' into transaction-tagging
# Conflicts:
#	fdbclient/NativeAPI.actor.cpp
2020-04-27 13:05:24 -07:00
A.J. Beamon 239876351b Add some initial auto-throttling. Move the definition of the priority enum to a more global place and use it for all transaction priorites (except in ClientLogEvents, because of serialization incompatibilites). 2020-04-24 11:31:16 -07:00
Jingyu Zhou 0ae0a81edf Ensure mutation logs save complete version's data
I.e., do not allow the same version's mutations saved in different files.
Otherwise, we may have a file only contain a version's partial data, causing
continuity analysis of mutation logs to fail. This could also cause restore
failures, if the target version's mutations are stored in two files.

In the above description, all mutation logs refer to the same tag's logs.
2020-04-20 20:41:30 -07:00
Jingyu Zhou 61f0f44ab3 Fix comments on startVersion in BackupWorker 2020-04-20 17:07:50 -07:00
Jingyu Zhou 5f43e18906 Backup worker pops max of savedVersion or NOOP's popVersion 2020-04-20 11:43:09 -07:00
Jingyu Zhou 70221a25d7 True-up a backup's begin version
For the first mutation log of a backup, we need to true-up its begin version to
the exact version of the first mutation. This is needed to ensure the strict
less than relationship between two mutation logs, if one's version range is
within the other.

A problematic scenario is as follows:
Epoch 1: a mutation log A [200, 900] is saved, but its progress is NOT saved.
Epoch 2: master recruits a worker for [1, 1000], 1000 is epoch 1's end version.
         New worker saves a mutation log B [100, 1000]
A's range is strict within B's range, but A's size is larger than B.

This happens because B's start version is true-up to the backup's begin version,
which is not the actual version of the first mutation. After B's begin version
is true-up to 300, we won't have this issue.
2020-04-20 11:06:46 -07:00
Jingyu Zhou 8245f12091 Backup worker doesn't save progress in NOOP mode
This fixes the consistency check failure, where saving progress commits new
transactions. Pop is performed by the NOOP loop in monitorBackupKeyOrPullData.
2020-04-20 11:06:46 -07:00
Jingyu Zhou cdc911a6ae Fix inadvertent savedVersion update 2020-04-20 11:06:46 -07:00
Jingyu Zhou 76d90ac6d7 Limit the version range for old epochs
When the Master recruits a backup worker for previous epochs, the Master may
set the begin version to a very low number, because the backup progress for
that epoch is not saved. This can cause problem for the log file, since these
low versions have been popped.

The fix here is to advance savedVersion to the minimum of backup's starting
version if it is higher than the begin version set by the Master. This is safe
because these versions are not popped. If they are popped, their progress should
already be recorded and Master would use a higher version than the backup's
starting version.
2020-04-20 11:06:46 -07:00
Jingyu Zhou 4e128328f7 Stop backup workers before clearing DB in parallel restore workload
This is because the clearing of DB can be picked up by backup workers and be
applied during restore, causing restore failures.
2020-04-11 10:26:08 -07:00
Jingyu Zhou 60407bdee3 Use LiteralStringRef for backup paused key 2020-04-07 16:02:25 -07:00
Jingyu Zhou 9fb3fb9d82 Add pause/resume for new backups
To pause/resume the backup workers, the fdbbackup command will write to the
backupPausedKey. Then backup workers noticed the value of the key has been
changed and stops/resumes pulling from TLog.
2020-04-06 14:29:46 -07:00
Jingyu Zhou 411b4c28ac Update mutation bytes written for new backups
This will make the log bytes written available to backup status and describe
backup calls.
2020-03-29 21:23:34 -07:00
Alex Miller 40d10aa990 Fix debugMutation uses that were concurrently added in new backup code 2020-03-27 04:01:18 -07:00
Jingyu Zhou 00fb4c1a35 Fix an off by one error
Backup worker's saved version should start from its startVersion - 1, i.e.,
the startVersion is not saved yet. Otherwise, if the version range is just
the startVersion itself and there is no data, then the range [startVersion,
startVersion + 1) will be missing. This causes non-continuous partitioned logs.
2020-03-24 23:40:36 -07:00
Jingyu Zhou 669916467e Add missing transaction reset call 2020-03-24 20:14:37 -07:00
Jingyu Zhou edcbeb8992 Address review comments
Move transaction object outside of the loop and rename trace events.
2020-03-24 18:22:20 -07:00
Jingyu Zhou a3058e7d96 Fix incorrectly marking a backup job as stopped
This causes missing version ranges for mutation logs.
2020-03-23 22:05:58 -07:00
Jingyu Zhou 82a1790776 Fix backup worker crash due to aborted backup job
If a backup job is aborted, the "startedBackupWorkers" key can be cleared, thus
triggering the assertion failure.
2020-03-23 21:11:25 -07:00
Jingyu Zhou f1d7fbafb4 Stop actors for displaced backup workers
If the worker is displaced, it should not update backup containers.
2020-03-23 18:48:06 -07:00
Jingyu Zhou fd7643c322 Remove a variable 2020-03-23 13:45:48 -07:00
Jingyu Zhou 90b40e1d75 Merge branch 'mengxu/new-backup-format-PR-delta' of github.com:xumengpanda/foundationdb into backup-worker-bak
Resolve Conflicts:
	fdbclient/BackupAgent.actor.h
	fdbserver/BackupWorker.actor.cpp
	fdbserver/RestoreMaster.actor.cpp
	fdbserver/masterserver.actor.cpp
2020-03-23 13:35:33 -07:00
Meng Xu be67ab4d6a Correct comment based on review 2020-03-23 12:53:40 -07:00
Meng Xu 3f31ebf659 New backup:Revise event name and explain code 2020-03-23 10:55:44 -07:00
Jingyu Zhou a8c2acdba0 Count the unique number of tags in startedBackupWorkers 2020-03-23 10:44:26 -07:00
Jingyu Zhou 1552653f1c Backup Worker: Cancel the actor when container is stopped 2020-03-22 21:08:11 -07:00
Jingyu Zhou 33ea027f84 Make sure only current epoch's backup workers update all workers
So that backup workers from old epochs don't mess with the list of all workers.
2020-03-22 18:28:22 -07:00
Jingyu Zhou 44c1996950 Change all worker started to be set after all workers updated a key
Previously, all worker started is set to be when saved log versions are higher.
However, saving the versions can be wrong, as the worker is not guaranteed to
write to the right container. For instance, if the watch is triggered later,
then mutation logs are written to previous containers. So we need to ensure the
right container is ready -- all workers have acknowledged seeing the container.
2020-03-22 16:40:12 -07:00
Jingyu Zhou 0fe2810425 Fix repeated backup progress checking in backup worker
The delay is not used, which caused repeated progress checking in worker 0.
2020-03-20 20:16:43 -07:00
Jingyu Zhou 4a499a3c97 Remove backup worker's first and last pop
The first pop of current epoch can pop old epoch's data before they are saved.
The last pop of a stopped backup worker should be skipped so that after
recovery, the data is still accessible in case the last epoch's progress saving
transaction is delayed.
2020-03-20 20:16:43 -07:00
Jingyu Zhou 9d6de758a7 Backup Worker: Give a chance of saving progress before displaced
Move the exit loop after the saving of progress so that when doneTrigger is
active, we won't exit the loop immediately.
2020-03-20 20:16:10 -07:00
Jingyu Zhou 08173951bc Add an exitEarly flag for backup worker
If a backup worker is on an old epoch, it could exit early if either of the
following is true:
- there is no backups
- all backups starts a version >= the endVersion

If this flag is set, the backup worker exit without doing any work, which
signals the master to update oldest backup epoch.
2020-03-20 20:15:09 -07:00
Jingyu Zhou 5b36dcaad5 Fix oldest backup epoch for backup workers
The oldest backup epoch is piggybacked in LogSystemConfig from master to
cluster controller and then to all workers. Previously, this epoch is set
to the current master epoch, which is wrong.
2020-03-20 20:15:09 -07:00