Depends on D3771
Adding AppendHolder to the proto file.
https://linear.app/comm/issue/ENG-672/create-addreferencetohashbyholder-in-the-blob-service
Differential D3772
[services] Blob - Add append holder to proto • karol on Apr 19 2022, 1:56 AM. Authored by Tags None Referenced Files
Details
Diff Detail
Event TimelineComment Actions
In general, would be great if I didn't need to leave comments like this, and you addressed them all preemptively with a more detailed explanation Comment Actions Sure.
There is no difference. it's the same method. Sorry for the confusion, I just wanted a shorter name.
I think this place isn't good for this. If you feel like it, we can prioritize the discussion in the associated task https://linear.app/comm/issue/ENG-430/consider-holder-to-not-be-unique
This method should be used when there's already an item in the database with a given hash so we will not have to attempt to upload the data again, but rather we just assign a new holder to the existing hash. I updated the task with proper explanations
Comment Actions Confusing processThis has been a really confusing process. In ENG-672, @karol-bisztyga proposed: AppendHolder(existingHolder, newHolder) This is why I asked:
Turns out at some point @karol-bisztyga changed his mind, and decided to make the API take blobHash exactly as I suggested! But instead of telling me something like "yes, I agree, I've changed it" he responded with "I think this place isn't good for this." We can just use PutNow that I understand what's actually going on here, I have another piece of feedback: I'm pretty sure we already have this API. We've explicitly talked about this scenario with Put, and have designed it to "short-circuit" if the blob already exists in the system and to skip re-uploading it. Can't we simply use Put in all cases we want to use AppendHolder? We specify holder and blobHash, and see if the server "short-circuits". If the server doesn't "short-circuit", then we should conclude that in fact the server doesn't have the blob in the question, and the blob must be reuploaded. In that scenario, what do we want the caller to do? I think we want the caller to reupload the blob, so continuing to use Put (as initially designed) seems like the right decision. Comment Actions Yes, now I see what went wrong. It was totally my fault and I apologize. I understood this task wrong because I didn't read the context carefully. I thought here we want to avoid re-uploading the same data. That was my mistake. The method from this task has a different purpose:
So it is more connected to handling attachments and the cleanup properly. I'm going to review the following diffs, some of them should probably be abandoned. About using put - yes, we should do this in this case, I created a task for this: https://linear.app/comm/issue/ENG-1030/make-sure-duplicate-hashes-are-added-to-the-database because looking at the code I'm not sure whether it does the job properly. I also created a task for handling attachments properly https://linear.app/comm/issue/ENG-1029/handle-attachments with a task I linked before https://linear.app/comm/issue/ENG-672/create-appendholder-in-the-blob-service as a child task. Overall, it's not a huge mistake but it is one for sure. It was just me not understanding some task I created a while ago. The method I added could be used but using put is just simpler and better. Once again, sorry for this, I'm going to try to pay more attention next time. Comment Actions As I said, this code is an effect of my not fully understanding the linear task. Sorry about that, abandoning. |