website icon indicating copy to clipboard operation
website copied to clipboard

Add Example of Multiple Writes in a Single Transaction to 'How to make multiple writes in a transaction' Tutorial

Open romainwg opened this issue 1 year ago • 1 comments

Current Title of the Web Page: How to make multiple writes in a transaction

Feedback:

I noticed that the current example on the page primarily demonstrates the structure of transactions using if, then, else, and commit statements. However, it does not include an example of making multiple writes within a single transaction.

To enhance the technical clarity and usefulness of this tutorial, I suggest adding an example (or modifying the existing one) to explicitly show how to perform multiple writes in a single transaction. Demonstrating a batch of operations would be particularly beneficial for users looking to understand this functionality better. For instance, an example that includes multiple Put operations within a single transaction would be very helpful.

Thank you for considering this improvement.

romainwg avatar Sep 25 '24 08:09 romainwg

Thanks for raising this @romainwg - I agree that page could certainly have some more comprehensive examples.

We should also replicate the change across to the 3.6 version page https://etcd.io/docs/v3.6/tutorials/how-to-transactional-write.

If you have time to propose a pull request please give it a try. I am happy to answer any questions and provide feedback 🙏🏻

jmhbnz avatar Sep 25 '24 09:09 jmhbnz

I'll give this a go! I will make a pr today or tmrw. I wanted to know how the gifs are uploaded to google store. @jmhbnz

NavinShrinivas avatar Oct 01 '24 09:10 NavinShrinivas

https://github.com/user-attachments/assets/b599e16e-b1a8-401f-a4e4-262f294f0e5e

I have this gif showing two examples, one with updating/writing to multiple keys

and the second trying two writes to the same transaction and failing

NavinShrinivas avatar Oct 01 '24 10:10 NavinShrinivas

I'll give this a go! I will make a pr today or tmrw. I wanted to know how the gifs are uploaded to google store. @jmhbnz

Hi, @NavinShrinivas. The images from the website are embedded in the repository. You can

  1. add it to static/img, and reference it by doing
    {{< figure src="/img/you-file.gif" >}}
    
  2. or create an img directory in the directory the page you're editing is, then call
    <img src="../img/your-file.gif alt="..." />
    

After surveying the repository, I don't think there's a standard, so either way should work.

ivanvc avatar Oct 12 '24 04:10 ivanvc

Noted! Did the changes in the pr. handled lint too.

awaiting your feedback :)

NavinShrinivas avatar Oct 12 '24 12:10 NavinShrinivas

Thanks for raising this @romainwg - I agree that page could certainly have some more comprehensive examples.

We should also replicate the change across to the 3.6 version page https://etcd.io/docs/v3.6/tutorials/how-to-transactional-write.

If you have time to propose a pull request please give it a try. I am happy to answer any questions and provide feedback 🙏🏻

Sorry for the delay, here's what I did: https://github.com/etcd-io/website/pull/908

romainwg avatar Oct 12 '24 12:10 romainwg

Hi @romainwg and @NavinShrinivas. I reviewed both of your pull requests. I wouldn't say that one is correct (or better than the other one). But it definitely adds contention to resolve this issue. Given that technically this wasn't assigned to anybody, and that @romainwg originally opened the issue, I would suggest to:

  1. Work together and co-author the commits in a single pull request (ref: GitHub documentation).
  2. We work on the pull requests in a chronological order, and if there are any improvements to @NavinShrinivas, @romainwg works on top of it.

Ideally, I would prefer a single pull request (1). But let me know your thoughts.

ivanvc avatar Oct 29 '24 17:10 ivanvc

Hi @romainwg and @NavinShrinivas. I reviewed both of your pull requests. I wouldn't say that one is correct (or better than the other one). But it definitely adds contention to resolve this issue. Given that technically this wasn't assigned to anybody, and that @romainwg originally opened the issue, I would suggest to:

  1. Work together and co-author the commits in a single pull request (ref: GitHub documentation).
  2. We work on the pull requests in a chronological order, and if there are any improvements to @NavinShrinivas, @romainwg works on top of it.

Ideally, I would prefer a single pull request (1). But let me know your thoughts.

Thank you @ivanvc

I don't want to sound pretentious, but I think our proposals are orthogonal.

On #908:

  • I've aligned the tutorial for transactions with the one for watch & delete.
  • I've also added a "real world" example which should be more meaningful

(And it may be too big for just one PR, but it's simpler for me.)

Also, when I posted the issue I had already started thinking about the best way to illustrate the transaction documentation. Due to lack of time, I wasn't able to propose it straight away.


If it makes things easier for the maintainers, I'll commit to the first PR, but my changes are quite different...

romainwg avatar Oct 29 '24 18:10 romainwg

~~@jmhbnz should we reopen because of #908?~~

Nevermind 😅

ivanvc avatar Nov 24 '24 08:11 ivanvc