Handle stats db conflicts

Since a timestamp is used as the document id, it's possible for e.g.
multiple nodes to attempt to insert the same document, resulting in
logged errors like the following:

[error] 2022-04-05T21:00:35.302496Z node1@127.0.0.1 emulator -------- Error in process <0.588.159> on node 'node1@127.0.0.1' with exit value:
{{nocatch,conflict},[{fabric,update_doc,3,[{file,"src/fabric.erl"},{line,332}]},{ioq_server,save_to_db,0,[{file,"src/ioq_server.erl"},{line,529}]}]}

This catches cases of `error:conflict` and logs them at info level
instead.
1 file changed
tree: cc388c45887a0b80d6aaa5997be3c905fbf5aa2c
  1. include/
  2. priv/
  3. src/
  4. test/
  5. .gitignore
  6. IOQ2.md
  7. operator_guide.md
  8. README.md
  9. rebar.config.script
README.md

IOQ classes

The following are the list of IOQ classes:

  • interactive
  • db_update
  • view_update
  • db_compact
  • view_compact
  • internal_repl
  • low

Bypassing IOQ

One can configure an ioq bypass, which removes an IO class from prioritization, as below:

config:set("ioq.bypass", "view_update", "true")

Note that setting an IOQ bypass can effectively trump all other classes, especially in the case of an interactive bypass v. compaction. This can lead to high disk usage.

Setting priorities

The priority for a class can also be set ala:

config:set("ioq", "compaction", "0.3")

Or globally, using snippet/rpc:

s:set_config("ioq", "compaction", "0.314", global)
rpc:multicall(config, set, ["ioq", "compaction", "0.217"])

As the interactive class is ‘everything else’ its priority cannot be directly set.