Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
romainwg opened this issue Sep 25, 2024 · 8 comments
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@romainwg
Copy link

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.

@jmhbnz jmhbnz added enhancement New feature or request help wanted Extra attention is needed good first issue Good for newcomers labels Sep 25, 2024
@jmhbnz
Copy link
Member

jmhbnz commented Sep 25, 2024

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 🙏🏻

@NavinShrinivas
Copy link
Contributor

NavinShrinivas commented Oct 1, 2024

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
Copy link
Contributor

ectd_transaction2.mp4

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

@ivanvc
Copy link
Member

ivanvc commented Oct 12, 2024

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.

@NavinShrinivas
Copy link
Contributor

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

awaiting your feedback :)

@romainwg
Copy link
Author

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: #908

romainwg pushed a commit to romainwg/website that referenced this issue Oct 12, 2024
…tion to tutorial

see: etcd-io#901
Signed-off-by: Romain WALCH--GUINEBERT <[email protected]>
romainwg pushed a commit to romainwg/website that referenced this issue Oct 12, 2024
…tion to tutorial

see: etcd-io#901
Signed-off-by: Romain WALCH--GUINEBERT <[email protected]>
@ivanvc
Copy link
Member

ivanvc commented Oct 29, 2024

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.

@romainwg
Copy link
Author

romainwg commented Oct 29, 2024

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants