Skip to content

Exclude without transaction system

Jingyu Zhou edited this page Feb 16, 2023 · 3 revisions
const KeyRangeRef configKeys("\xff/conf/"_sr, "\xff/conf0"_sr);

const KeyRangeRef excludedServersKeys("\xff/conf/excluded/"_sr, "\xff/conf/excluded0"_sr);

EmergencyTransactionMutation

Provisional master is started in parallel with recruitment (recruitEverything()). So if recruitment is stalled, the provisional master can accept configuration changes and perform a new recruitment.

Simulation starts DB with initial configuration https://github.com/jzhou77/foundationdb/blob/2983dfe860d8cd8cfb705c528a48d3c1256128a6/fdbserver/tester.actor.cpp#L1773

			wait(timeoutError(changeConfiguration(cx, testers, startingConfiguration), 2000.0));

This creates a new ChangeConfig workload, which perform the configuration change. Note the transaction uses USE_PROVISIONAL_PROXIES flag: https://github.com/jzhou77/foundationdb/blob/2983dfe860d8cd8cfb705c528a48d3c1256128a6/fdbclient/include/fdbclient/GenericManagementAPI.actor.h#L577-L580

ACTOR template <class DB>
Future<ConfigurationResult> autoConfig(Reference<DB> db, ConfigureAutoResult conf) {
	state Reference<typename DB::TransactionT> tr = db->createTransaction();
	state Key versionKey = BinaryWriter::toValue(deterministicRandom()->randomUniqueID(), Unversioned());

	if (!conf.address_class.size())
		return ConfigurationResult::INCOMPLETE_CONFIGURATION; // FIXME: correct return type

	loop {
		try {
			tr->setOption(FDBTransactionOptions::ACCESS_SYSTEM_KEYS);
			tr->setOption(FDBTransactionOptions::PRIORITY_SYSTEM_IMMEDIATE);
			tr->setOption(FDBTransactionOptions::LOCK_AWARE);
			tr->setOption(FDBTransactionOptions::USE_PROVISIONAL_PROXIES);
...

Normal fdbcli's exclude command goes through management API to special key space:

const KeyRangeRef excludedServersSpecialKeyRange("\xff\xff/management/excluded/"_sr,
                                                 "\xff\xff/management/excluded0"_sr);

The special key space implementation will strip the management prefix \xff\xff/management https://github.com/jzhou77/foundationdb/blob/2983dfe860d8cd8cfb705c528a48d3c1256128a6/fdbclient/SpecialKeySpace.actor.cpp#L901 and add the correct prefix \xff/conf/. Note the transaction for exclusion only has SPECIAL_KEY_SPACE_ENABLE_WRITES flag, https://github.com/jzhou77/foundationdb/blob/2983dfe860d8cd8cfb705c528a48d3c1256128a6/fdbcli/ExcludeCommand.actor.cpp#L44

Clone this wiki locally