diff --git a/fdbclient/BackupContainer.actor.cpp b/fdbclient/BackupContainer.actor.cpp index f24a0d3bc3..080fd220c5 100644 --- a/fdbclient/BackupContainer.actor.cpp +++ b/fdbclient/BackupContainer.actor.cpp @@ -26,6 +26,7 @@ #include "flow/UnitTest.h" #include "flow/Hash3.h" #include "fdbrpc/AsyncFileReadAhead.actor.h" +#include "fdbrpc/simulator.h" #include "flow/Platform.h" #include "fdbclient/AsyncFileBlobStore.actor.h" #include "fdbclient/Status.h" @@ -1611,7 +1612,10 @@ public: if(g_network->isSimulated()) { if(!fileExists(fullPath)) throw file_not_found(); - std::string uniquePath = fullPath + "." + deterministicRandom()->randomUniqueID().toString() + ".lnk"; + if (g_simulator.getCurrentProcess()->uid == UID()) { + TraceEvent(SevError, "BackupContainerReadFileOnUnsetProcessID"); + } + std::string uniquePath = fullPath + "." + g_simulator.getCurrentProcess()->uid.toString() + ".lnk"; unlink(uniquePath.c_str()); ASSERT(symlink(basename(path).c_str(), uniquePath.c_str()) == 0); fullPath = uniquePath; diff --git a/fdbrpc/simulator.h b/fdbrpc/simulator.h index d81e5763a1..caf6fbd2c1 100644 --- a/fdbrpc/simulator.h +++ b/fdbrpc/simulator.h @@ -67,13 +67,16 @@ public: uint64_t fault_injection_r; double fault_injection_p1, fault_injection_p2; + UID uid; + ProcessInfo(const char* name, LocalityData locality, ProcessClass startingClass, NetworkAddressList addresses, - INetworkConnections *net, const char* dataFolder, const char* coordinationFolder ) - : name(name), locality(locality), startingClass(startingClass), - addresses(addresses), address(addresses.address), dataFolder(dataFolder), - network(net), coordinationFolder(coordinationFolder), failed(false), excluded(false), cpuTicks(0), - rebooting(false), fault_injection_p1(0), fault_injection_p2(0), - fault_injection_r(0), machine(0), cleared(false) {} + INetworkConnections* net, const char* dataFolder, const char* coordinationFolder) + : name(name), locality(locality), startingClass(startingClass), addresses(addresses), + address(addresses.address), dataFolder(dataFolder), network(net), coordinationFolder(coordinationFolder), + failed(false), excluded(false), cpuTicks(0), rebooting(false), fault_injection_p1(0), fault_injection_p2(0), + fault_injection_r(0), machine(0), cleared(false) { + uid = deterministicRandom()->randomUniqueID(); + } Future onShutdown() { return shutdownSignal.getFuture(); }