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

Pumice db #2

Closed
wants to merge 19 commits into from
Closed

Pumice db #2

wants to merge 19 commits into from

Conversation

00pauln00
Copy link
Owner

No description provided.

It was enabling, not disabling.
This is very high level and there are probably still lots of incorrect
assumptions floating around.
More fleshing out of the read and write handlers including how KV pairs
will be shared with the upper and lower layer (the lower layer is needed
so that pending commit state may be tracked per-application object).
This patch mostly deals with the implementation of pmdb_object_lookup()
and its supporting code.  pmdb_object_lookup() starts to work with the
rocksDB api to lookup the KV for a PMDB object.  A PMDB object will have
binary contents in the form of struct pmdb_object, which has been
defined in this patch.  Note that pmdb_object_lookup() is not concerned
with the application API at all.  It's only used within the PumiceDB
private column-family for accessing the shadow metadata which PumiceDB
stores on behalf of all application objects.

The patch also implements a method for determining whether a write
operation is pending to application object through the use of a term
value held in the pmdb_object.  A term which is == to the current term
means that the a write is pending and no others may be accepted until it
completes.  It also means that the apply of the object (through commit)
must reset that term value.  The pmdb_object::term value is neutralized
when a leader election occurs and the held term is < the current raft
term.

pmdb_sm_handler_client_write() is also coming along but still needs some
work.  It also uses the newly introduced lookup method to obtain the
application's pumice metadata.  The error handling is still a bit of
mess (though this is somewhat expected).
PumiceDB needs to support supplementary atomic KV writes with both
raft-entry writes and state machine application.  This patch starts to
implement a simple API for attaching KVs to struct
raft_net_client_request so that these may be included in rockds write
batches.

One the raft-entry write end, pumiceDB must be updated so that the
application object gets a pending marker placed into rocksDB atomically
with the raft-entry.  This is meant to prevent retried writes on the
same seqno from entering raft and causing idempotency issues.

On the state machine application side, the supplement will be raft
itself.  Here, raft will store some metadata marking which commits have
been applied into rocksDB, again, with the goal of preventing
idempotency related issues.
This patch adds the write supplements functions which are to be for
passing KVs from the state machine back to the raft-server logic.

Added a new raft-backend-api call:  rib_sm_apply_opt().
This is called after the SM callback is run in commit-apply context.
The SM is to present all KVs it wishes to have written into the backend
- it does not write these itself!  The raft backend implementation will
execute the write itself and may encode other non-SM related metadata,
such as the last-applied raft index.
Just some minor changes following a cursory review.
Use raft_client_net_request_error_set() instead of setting reply errors
directly.
This patch adds the pmdb object as a KV to raft client request write
supplement.  The patch also implements the crc calculation of the pmdb
object.
The raft_instance_backend rib_entry_write func pointer now accepts a
raft_net_sm_write_supplements pointer.  This pointer is optional and
will be used (at this time) only by the rockdsDB backend.

Note the write api may be (and should be) simplified in the future to
accept one set of KVs instead the raft-entry pointer and a set of KVs.
The raft-entry itself can be passed as a KV in the same set as the
supplements.
Write supplements are now considered for both rsbr_entry_write() as well
as rsbr_sm_apply_opt(), which is implemented in this patch.
pmdb_apply_sm_handler_t parameters have been modified to reflect the new
rocksdb write model where writes are applied in raft backend context
rather than in pumiceDB.  This means that pumiceDB applications do not
need to issue rocksDB write calls in order to store there KVs.

pmdb_sm_handler() has now been modified to support
RAFT_NET_CLIENT_REQ_TYPE_COMMIT.

A new external function, PmdbWriteKV(), has been added in this patch.
PmdbWriteKV() is used by pumiceDB applications to stage KVs for storing
into rocksDB in the context of pmdb_apply_sm_handler_t.  These KVs will
be written atomically with any KVs added by pumiceDB.
Added a make target for it as well which builds a shared library.
pmdb_sm_handler_pmdb_sm_apply() was forgetting to unset the pending term
element in the pmdb_object KV.  This patch fixes the situation by adding
the pmdb_obj to the sm_apply write supplement.

Implement PmdbClose().

Add comments to the header files for the exported PMDB calls.
Add libpumice.so.1.0.1 to .gitignore
This test server uses the pumiceDB api to implement the same server
behaviour found in raft_server_test.c.  The idea, for now, is to reuse
the same client (raft_client_test.c) to verify that pumiceDB achieves
basic functionality.
Fix a few minor compilation problems and add to the makefile.
@00pauln00 00pauln00 closed this Sep 3, 2020
@00pauln00 00pauln00 deleted the pumiceDB branch September 22, 2020 17:30
bergstartup added a commit that referenced this pull request Aug 10, 2022
Deletion of stale ctl entries using timeout
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant