Non-exclusive get_for_update

Aperta
#483 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
20/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
rust

Direzione di ricerca

Inizia con la Rust transaction API e l’implementazione di get_for_update a cui fa riferimento la issue, quindi confrontane il comportamento con le modalità esclusiva e non esclusiva di RocksDB. Determina se TiKV supporta i lock condivisi ed esclusivi per questo scenario di ricostruzione dell’indice; il lavoro sarà considerato completato con un approccio supportato e documentato oppure con una proposta di funzionalità chiaramente circoscritta.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Hey!

I'm looking for an alternative to rocksdb's get_for_update method. My goal is to basically implement an RwLock between transactions.

In rocksdb, AFAIU I can use get_for_update with exclusive = false for my read locks, and with exclusive = true for my write locks.

However, I can't find any way to do something similar with tikv. Do you know if one such way actually exists, or is it unsupported?

For more context, I have an index that I want to rebuild. And I don't want to implement a full shadow-index like TiDB seems to do, among other reasons because I can't find a way to ask TiKV to stream all modified keys to me. So in order to avoid anyone writing while I'm rebuilding the index, I want to just have all transactions touching the index (be it read-only or write-only) to take a shared lock on the index table; and to have the index-rebuilding transaction take an exclusive lock on the index table.

Does that make sense to you, and if yes how would you implement that with TiKV?

Anyway, TiKV seems very interesting from afar! I hope I'll soon have a chance to start using it in practice too 😄

PS: I also checked the source code, and it seems to be following basically the same path for get_for_update as for put, so I'm expecting that two concurrent get_for_update will write-conflict. But maybe I'm misunderstanding the code and get_for_update is actually never exclusive, in which case I could just have my read transactions use get_for_update, and my write transactions use put with some random value!

Lingua principale
Rust
Stelle
434
Fork
168
Merge medio
4g 12h
PR unite (30g)
2

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di tikv/client-rust

Tutte le issue di tikv/client-rust

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.