Analysis of whether any given RPC is safe to retry. Because of potential
corruption, I'm tempted to whitelist them instead of blacklist them. However,
99% of requests are safe, so whitelisting is a bit of a pain.
I'm thinking to use the 'info' parameter of register_lazy to signal the
retry-semantics of a given command.
'append', 'bzrlib.smart.vfs', 'AppendRequest')
Not safe. The current location in the file is tracked on the client for some
callers of this function. An append which succeeded but then got retried will
put bad data in the middle of the file.
'Branch.set_tags_bytes', 'bzrlib.smart.branch',
'SmartServerBranchSetTagsBytes')
safe, this is an all-or-nothing set. so setting it two times to the same thing
still leaves you at the same content in the end.
'Branch.lock_write', 'bzrlib.smart.branch', 'SmartServerBranchRequestLockWrite')
safe, will fail if first succeeded
safe in that it won't cause corruption. not safe in that if the first request
succeeds and the connection dies (so we don't get to see the lock tocken), the
second request will fail because the branch is already locked.
I'm still willing to call this 'safe', since it won't silently corrupt
anything. The worst case is that the action will get interrupted, but we
already had that problem because of ConnectionReset. (Retrying is strictly
better than not retrying.)
'Branch.set_config_option', 'bzrlib.smart.branch', 'SmartServerBranchRequestSetConfigOption')
I think this is safe. Setting an option to the same value twice should be safe.
The config code already should handle multiple concurrent requests.
'Branch.set_last_revision', 'bzrlib.smart.branch', 'SmartServerBranchRequestSetLastRevision')
deprecated function, since it uses branch._lefthand_history to determine the
revision number to store. However, still safe, as setting the tip revision to
the same value is safe.
'Branch.unlock', 'bzrlib.smart.branch', 'SmartServerBranchRequestUnlock')
safe, will fail if first succeeded
same as the lock_write call. If the first one succeeds, the second one will
fail with a 'not locked' and cause us to spuriously interrupt what we are
doing. However, it is still 'safe' in that we would have already interrupted
the process because of ConnectionReset.
'rename', 'bzrlib.smart.vfs', 'RenameRequest')
safe, will fail if first succeeded
'PackRepository.autopack', 'bzrlib.smart.packrepository', 'SmartServerPackRepositoryAutopack')
safe, a bit unfortunate if it actually does the work twice, but I think we have
good "oh, i'm already well packed, nothing to do" logic around here already.
'Repository.insert_stream', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStream')
'Repository.insert_stream_1.19', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStream_1_19')
'Repository.insert_stream_locked', 'bzrlib.smart.repository', 'SmartServerRepositoryInsertStreamLocked')
safe, in that a repository is allowed to have the same content multiple times.
Note that from the client-side, it isn't possible to restart this trivially,
because the stream is a generator that gets consumed, and can't be trivially
restarted from the beginning.
'Repository.lock_write', 'bzrlib.smart.repository', 'SmartServerRepositoryLockWrite')
safe, will fail if first succeeded
'Repository.set_make_working_trees', 'bzrlib.smart.repository', 'SmartServerRepositorySetMakeWorkingTrees')
safe, setting the flag to the same thing twice just leaves us in the same place
'Repository.unlock', 'bzrlib.smart.repository', 'SmartServerRepositoryUnlock')
safe, will fail if first succeeded
'Repository.tarball', 'bzrlib.smart.repository', 'SmartServerRepositoryTarball')
safe, read-only, do we even still support this verb? I really thought we wanted
this disabled because it adds too much load to the server, and the client no
longer tries it.
'rmdir', 'bzrlib.smart.vfs', 'RmdirRequest')
safe, will fail if first succeeded
Analysis of whether any given RPC is safe to retry. Because of potential
corruption, I'm tempted to whitelist them instead of blacklist them. However,
99% of requests are safe, so whitelisting is a bit of a pain.
I'm thinking to use the 'info' parameter of register_lazy to signal the
retry-semantics of a given command.
'append', 'bzrlib.smart.vfs', 'AppendRequest')
Not safe. The current location in the file is tracked on the client for some
callers of this function. An append which succeeded but then got retried will
put bad data in the middle of the file.
'Branch. get_config_ file', 'bzrlib. smart.branch' , rBranchGetConfi gFile')
'SmartServe
safe, read-only
'Branch. get_parent' , 'bzrlib. smart.branch' , 'SmartServerBra nchGetParent' )
safe, read-only
'Branch. get_tags_ bytes', 'bzrlib. smart.branch' , rBranchGetTagsB ytes')
'SmartServe
safe, read-only
'Branch. set_tags_ bytes', 'bzrlib. smart.branch' , rBranchSetTagsB ytes')
'SmartServe
safe, this is an all-or-nothing set. so setting it two times to the same thing
still leaves you at the same content in the end.
'Branch. get_stacked_ on_url' , 'bzrlib. smart.branch' , 'SmartServerBra nchRequestGetSt ackedOnURL' )
safe, read-only
'Branch. last_revision_ info', 'bzrlib. smart.branch' , 'SmartServerBra nchRequestLastR evisionInfo' )
safe, read-only
'Branch. lock_write' , 'bzrlib. smart.branch' , 'SmartServerBra nchRequestLockW rite')
safe, will fail if first succeeded
safe in that it won't cause corruption. not safe in that if the first request
succeeds and the connection dies (so we don't get to see the lock tocken), the
second request will fail because the branch is already locked.
I'm still willing to call this 'safe', since it won't silently corrupt
anything. The worst case is that the action will get interrupted, but we
already had that problem because of ConnectionReset. (Retrying is strictly
better than not retrying.)
'Branch. revision_ history' , 'bzrlib. smart.branch' , 'SmartServerReq uestRevisionHis tory')
safe, read-only
'Branch. set_config_ option' , 'bzrlib. smart.branch' , 'SmartServerBra nchRequestSetCo nfigOption' )
I think this is safe. Setting an option to the same value twice should be safe.
The config code already should handle multiple concurrent requests.
'Branch. set_last_ revision' , 'bzrlib. smart.branch' , 'SmartServerBra nchRequestSetLa stRevision' ) _lefthand_ history to determine the
deprecated function, since it uses branch.
revision number to store. However, still safe, as setting the tip revision to
the same value is safe.
'Branch. set_last_ revision_ info', 'bzrlib. smart.branch' , 'SmartServerBra nchRequestSetLa stRevisionInfo' )
safe
'Branch. set_last_ revision_ ex', 'bzrlib. smart.branch' , 'SmartServerBra nchRequestSetLa stRevisionEx' )
safe
'Branch. set_parent_ location' , 'bzrlib. smart.branch' , 'SmartServerBra nchRequestSetPa rentLocation' )
safe
'Branch. unlock' , 'bzrlib. smart.branch' , 'SmartServerBra nchRequestUnloc k')
safe, will fail if first succeeded
same as the lock_write call. If the first one succeeds, the second one will
fail with a 'not locked' and cause us to spuriously interrupt what we are
doing. However, it is still 'safe' in that we would have already interrupted
the process because of ConnectionReset.
'BzrDir. cloning_ metadir' , 'bzrlib. smart.bzrdir' , 'SmartServerBzr DirRequestCloni ngMetaDir' )
safe, read-only
'BzrDir. create_ branch' , 'bzrlib. smart.bzrdir' , 'SmartServerReq uestCreateBranc h')
safe, will fail if first succeeded
'BzrDir. create_ repository' , 'bzrlib. smart.bzrdir' , 'SmartServerReq uestCreateRepos itory')
safe, will fail if first succeeded
'BzrDir. find_repository ', 'bzrlib. smart.bzrdir' , 'SmartServerReq uestFindReposit oryV1')
safe, read-only
'BzrDir. find_repository V2', 'bzrlib. smart.bzrdir' , 'SmartServerReq uestFindReposit oryV2')
safe, read-only
'BzrDir. find_repository V3', 'bzrlib. smart.bzrdir' , 'SmartServerReq uestFindReposit oryV3')
safe, read-only
'BzrDir. get_config_ file', 'bzrlib. smart.bzrdir' , 'SmartServerBzr DirRequestConfi gFile')
safe, read-only
'BzrDirForm at.initialize' , 'bzrlib. smart.bzrdir' , 'SmartServerReq uestInitializeB zrDir')
safe, will fail if first succeeded
'BzrDirForm at.initialize_ ex_1.16' , 'bzrlib. smart.bzrdir' , 'SmartServerReq uestBzrDirIniti alizeEx' )
safe, will fail if first succeeded
'BzrDir.open', 'bzrlib. smart.bzrdir' , 'SmartServerReq uestOpenBzrDir' )
safe, read-only
'BzrDir. open_2. 1', 'bzrlib. smart.bzrdir' , 'SmartServerReq uestOpenBzrDir_ 2_1')
safe, read-only
'BzrDir. open_branch' , 'bzrlib. smart.bzrdir' , 'SmartServerReq uestOpenBranch' )
safe, read-only
'BzrDir. open_branchV2' , 'bzrlib. smart.bzrdir' , 'SmartServerReq uestOpenBranchV 2')
safe, read-only
'BzrDir. open_branchV3' , 'bzrlib. smart.bzrdir' , 'SmartServerReq uestOpenBranchV 3')
safe, read-only
'delete', 'bzrlib.smart.vfs', 'DeleteRequest')
safe, will fail if first succeeded
'get', 'bzrlib.smart.vfs', 'GetRequest')
safe, read-only
'get_bundle', 'bzrlib. smart.request' , 'GetBundleRequest')
safe, read-only
'has', 'bzrlib.smart.vfs', 'HasRequest')
safe, read-only
'hello', 'bzrlib. smart.request' , 'HelloRequest')
safe, read-only
'iter_ files_recursive ', 'bzrlib.smart.vfs', 'IterFilesRecur siveRequest' )
safe, read-only
'list_dir', 'bzrlib.smart.vfs', 'ListDirRequest')
safe, read-only
'mkdir', 'bzrlib.smart.vfs', 'MkdirRequest')
safe, will fail if first succeeded
'move', 'bzrlib.smart.vfs', 'MoveRequest')
safe, will fail if first succeeded
'put', 'bzrlib.smart.vfs', 'PutRequest')
safe, putting the same content twice leaves you with the same content
'put_ non_atomic' , 'bzrlib.smart.vfs', 'PutNonAtomicRe quest')
safe, putting the same content twice leaves you with the same content
'readv', 'bzrlib.smart.vfs', 'ReadvRequest')
safe, read-only
'rename', 'bzrlib.smart.vfs', 'RenameRequest')
safe, will fail if first succeeded
'PackReposi tory.autopack' , 'bzrlib. smart.packrepos itory', 'SmartServerPac kRepositoryAuto pack')
safe, a bit unfortunate if it actually does the work twice, but I think we have
good "oh, i'm already well packed, nothing to do" logic around here already.
'Repository .gather_ stats', 'bzrlib. smart.repositor y', 'SmartServerRep ositoryGatherSt ats')
safe, read-only
'Repository .get_parent_ map', 'bzrlib. smart.repositor y', 'SmartServerRep ositoryGetParen tMap')
safe, read-only
'Repository .get_revision_ graph', 'bzrlib. smart.repositor y', 'SmartServerRep ositoryGetRevis ionGraph' )
safe, read-only
'Repository .has_revision' , 'bzrlib. smart.repositor y', 'SmartServerReq uestHasRevision ')
safe, read-only
'Repository .insert_ stream' , 'bzrlib. smart.repositor y', 'SmartServerRep ositoryInsertSt ream') .insert_ stream_ 1.19', 'bzrlib. smart.repositor y', 'SmartServerRep ositoryInsertSt ream_1_ 19') .insert_ stream_ locked' , 'bzrlib. smart.repositor y', 'SmartServerRep ositoryInsertSt reamLocked' )
'Repository
'Repository
safe, in that a repository is allowed to have the same content multiple times.
Note that from the client-side, it isn't possible to restart this trivially,
because the stream is a generator that gets consumed, and can't be trivially
restarted from the beginning.
'Repository .is_shared' , 'bzrlib. smart.repositor y', 'SmartServerRep ositoryIsShared ')
safe, read-only
'Repository .lock_write' , 'bzrlib. smart.repositor y', 'SmartServerRep ositoryLockWrit e')
safe, will fail if first succeeded
'Repository .set_make_ working_ trees', 'bzrlib. smart.repositor y', 'SmartServerRep ositorySetMakeW orkingTrees' )
safe, setting the flag to the same thing twice just leaves us in the same place
'Repository .unlock' , 'bzrlib. smart.repositor y', 'SmartServerRep ositoryUnlock' )
safe, will fail if first succeeded
'Repository .get_rev_ id_for_ revno', 'bzrlib. smart.repositor y', 'SmartServerRep ositoryGetRevId ForRevno' )
safe, read-only
'Repository .get_stream' , 'bzrlib. smart.repositor y', 'SmartServerRep ositoryGetStrea m')
safe, read-only
'Repository .get_stream_ 1.19', 'bzrlib. smart.repositor y', 'SmartServerRep ositoryGetStrea m_1_19' )
safe, read-only
'Repository .tarball' , 'bzrlib. smart.repositor y', 'SmartServerRep ositoryTarball' )
safe, read-only, do we even still support this verb? I really thought we wanted
this disabled because it adds too much load to the server, and the client no
longer tries it.
'rmdir', 'bzrlib.smart.vfs', 'RmdirRequest')
safe, will fail if first succeeded
'stat', 'bzrlib.smart.vfs', 'StatRequest')
safe, read-only
'Transport. is_readonly' , 'bzrlib. smart.request' , 'SmartServerIsR eadonly' )
safe, read-only