xp icon indicating copy to clipboard operation
xp copied to clipboard

NodeId and NodePath are excess in NodeVersion fetching methods

Open vbradnitski opened this issue 3 years ago • 1 comments

To refactor and deprecate.

Methods like:

NodeService.getByIdAndVersionId NodeStorageService.get NodeStorageService.getNode NodeStorageService.getVersion

Classes like: GetNodeByIdAndVersionIdCommand

vbradnitski avatar Nov 15 '21 13:11 vbradnitski

Reasons: After work on #9205 it became evident that a few methods with NodeVersion parameter also require NodeId that is only used for ES routing. Routing is worthless when there is only one shard per index - like in our case. (exception is parent/child index, when parent is not known, but we can use ANY routing, it will still land on the same single shard)

  • Sometimes NodeId is not known and methods that need to call such method do a worthless query trying to guess correct NodeId.
  • NodeStorageService.get and NodeStorageService.getNode are very similar, but get also requests branchService, to construct a bogus node with "previous" data but some fields overridden with "current" values. It is confusing, especially because method is called "get" and may be used incorrectly.

rymsha avatar Nov 15 '21 13:11 rymsha

NodeService.getByIdAndVersionId should still require NodeId (on high level we need to be sure NodeVersion has correct NodeId) The rest of the methods will be cleaned up in #9930

rymsha avatar Dec 19 '22 12:12 rymsha