Skip to content

Mas i1813 keepamnesia#1830

Merged
martinsumner merged 26 commits into
develop-3.0from
mas-i1813-keepamnesia
May 13, 2022
Merged

Mas i1813 keepamnesia#1830
martinsumner merged 26 commits into
develop-3.0from
mas-i1813-keepamnesia

Conversation

@martinsumner

Copy link
Copy Markdown
Contributor

Introduces a reader overflowq for doing read repair operations. Initially this is used for:

  • repair_keys_range aae_fold - avoids the pausing of the fold that would block the worker pool;
  • repair on key_amnesia - triggers the required repair rather than causing an AAE delta;
  • repair on finding a corrupted object when folding to rebuild aae_store - previously the fold would crash, and the AAE store would therefore never be rebuilt. This PR is required to make this consistent in both AAE solutions.

Also don't log queues on a crash - avoid over-sized crash dumps
Have the queue backed to disk, so that beyond a certain size it overflows from memory to disk (and once the on disk part is consumed from the queue the files are removed).
Risk of misconfiguration leading to wiping of wrong data.  Also starting a job may lead to the main process having its disk_log wiped.
Avoid enoent errors
Check for a soft overload on any vnode before reaping.  This will add some delay - but reap has been show to potentially overload a cluster ... availability is more important than reap speed.

There is no catch for {error, mailbox_overload} should it occur - it should not as the mailbox check should prevent it.  If it does, the reaper will crash (and restart without any reaps) - return to a safe known position.
The queue file generated, are still in UUID format, but the id now incorporates creation date.  This should make it easier to detect and clean any garbage that might be accrued.

One use case where '++' is used has also been removed (although a lists:flatten/1 was still required at the end in this case)
Refactor riak_kv_replrtq_src to use the riak_kv_overflow_queue, and allow for larger queues to be supported without leading to memory exhaustion.

Issues still with eqc test.  Also issue of inaccurate accounting of maximum queue size, and setting sizes (and their defaults) at startup.

The popping from rtq is also a bit ugly, would be nice to have some cleaner code for this.
… false

If ObjectLimit == 0, then this might not be the case
This now passes 10K eqc tests of replrtq_eqc.

Stat of discards added to riak_kv_stats
There will be no attempt to re-open overflow on startup.  The queue is persisted to avoid over-consumption of memory, not so that replication requests can be persisted across reboots
Add equivalent to reaper/eraser clear function, which can be used when resetting the size of overflow queues
Default them all to the same value for simplicity, and name the configuration item consistently (although there is a subtle difference in the implementation for replrtq)
Needs to change size limit stored on state.  Also remove previous (and now redundant) configuration: replrtq_srcqueuelimit now replaced with replrtq_overflow_limit
Use the reader queue for repair_keys_range, but also to trigger a read repair when there is key amnesia on a non-coordinating node to resolve the inconsistency without waiting for AAE.
Don't add a corrupted object when rebuilding - instead log, skip past, and prompt read repair.

The behaviour before was to avoid crashing on inserting a corrupted object (whereby the vector clock cannot be extracted for hashing).  Not clear why this is still inserted.  This behaviour is maintained, with the alternative behaviour during the rebuild.

The same handle_corrupted_object/4 fun is then re-used during parallel mode tictac aae rebuilds, with a new version of kv_index_tictactree which catches exceptions and allows an external function to be used for handling them).
@s2hc-johan

Copy link
Copy Markdown

Looks good, I think

@martinsumner
martinsumner merged commit 71923c0 into develop-3.0 May 13, 2022
@martinsumner

Copy link
Copy Markdown
Contributor Author

Related to #1814

martinsumner added a commit that referenced this pull request May 31, 2022
Merge in changes from Riak 3.0.10.

Includes PRs:

- #1809
- #1812
- #1814
- #1816
- #1829
- #1830
hmmr pushed a commit to TI-Tokyo/basho-riak_kv that referenced this pull request Nov 23, 2022
Introduces a reader overflowq for doing read repair operations.  Initially this is used for:

- repair_keys_range aae_fold - avoids the pausing of the fold that would block the worker pool;
- repair on key_amnesia - triggers the required repair rather than causing an AAE delta;
- repair on finding a corrupted object when folding to rebuild aae_store - previously the fold would crash, and the AAE store would therefore never be rebuilt.  [This PR](martinsumner/kv_index_tictactree#106) is required to make this consistent in both AAE solutions.
# Conflicts:
#	priv/riak_kv.schema
#	rebar.config
#	src/riak_kv_clusteraae_fsm.erl
#	src/riak_kv_index_hashtree.erl
#	src/riak_kv_vnode.erl
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.

2 participants