libraft
libraft copied to clipboard
Rw shore
The two commits on the RWShore branch solve the following problems:
- table-create statements used highly non-standard SQL. TINYINT turns out to be non-standard (changed to SMALLINT). More importantly, the IF NOT EXISTS clause isn't standard and broke (in particular) the embedded Derby database I wanted to use. Fixing the log and store was simple: use the database metadata to see if the table exists. The snapshot DAO object is a hack: simply ignore exceptions thrown from the create code. There may be a better way to fix the DAO object, but I didn't have the time to figure out how the JDBI package works.
- For reasons that I don't understand, different hosts on my network resolve hostnames differently; some pick up the IPv4 address and some the IPv6 address. This prevents all the nodes from communicating, since some nodes were listening on the v6 address but other nodes were attempting to contact them using the v4 address. My fix is to add an all-address boolean flag to the RAFT configuration; if the flag is true, then the fully-resolved bind address used for the server employs the port number only (making the IP address a wildcard and effectively binding the server to both the v4 and v6 addresses).