<commit_before>

New view handling
=================

Author: <NAME>
Version: $Id: ViewHandling.txt,v 1.2 2005/10/05 08:41:40 belaban Exp $

Problem:
Merge, join and leave requests need to handled in the order in which they arrive. Currently,
the merge handling is independent from the view handling, which results in problems with generating
merge VIDs which are lower than the highest VIDs generated by the view handling, as described
in MergeProblem.txt.

Proposed solution:
- Turn the ViewBroadcaster into a ViewHandler which has a queue
- JOIN, LEAVE and MERGE requests received by the coordinator simply add an entry to the queue
- A thread dequeues elements from that queue and processes them, one at a time, to ensure FIFO handling
  of those requests
  --> One result of this is that the merge handling is now *not* done asynchronously anymore !
- A side effect of this is that we could implement a feature which waits for N JOIN/LEAVE requests or M milliseconds,
  and then processes a number of JOIN and LEAVE requests as *one* view, which is more efficient, given the fact that
  views are transmitted reliable, ie. for each view we need to receive an ack from each member
- When the coordinator itself leave, we need to flush the queue, ie. not accept new requests, and complete the
  existing requests

<commit_msg>no message<commit_after>

New view handling
=================

Author: <NAME>
Version: $Id: ViewHandling.txt,v 1.3 2005/10/05 11:33:17 belaban Exp $

Problem:
Merge, join and leave requests need to handled in the order in which they arrive. Currently,
the merge handling is independent from the view handling, which results in problems with generating
merge VIDs which are lower than the highest VIDs generated by the view handling, as described
in MergeProblem.txt.

Proposed solution:
- Turn the ViewBroadcaster into a ViewHandler which has a queue
- JOIN, LEAVE and MERGE requests received by the coordinator simply add an entry to the queue
- A thread dequeues elements from that queue and processes them, one at a time, to ensure FIFO handling
  of those requests
  --> One result of this is that the merge handling is now *not* done asynchronously anymore !
- A side effect of this is that we could implement a feature which waits for N JOIN/LEAVE requests or M milliseconds,
  and then processes a number of JOIN and LEAVE requests as *one* view, which is more efficient, given the fact that
  views are transmitted reliable, ie. for each view we need to receive an ack from each member
- When the coordinator itself leave, we need to flush the queue, ie. not accept new requests, and complete the
  existing requests

Merging:
- When we receive a MERGE event, the merge coordinator needs to inform all coordinators involved to flush their queues
  in the ViewHandler.
- This processes all requests in the queue, then simply discards new requests (or queues them in
  a separate queue). We could also simply discard all current requests in the queue, since for example a JOIN
  request will redirect its JOIN-REQ to a new coordinator until successful.
- When the merge has successfully run (or aborted), all the queues in the ViewHandlers need to resume
- The reason for doing this is that the MergeView's VID needs to be higher than any view seen by any of the
  coordinators participating in the merge. If a coordinator was allowed to continue generating new views, then
  this would not be the case



{'fraction_non_alphanumeric': 0.045930232558139536, 'fraction_numerical': 0.009302325581395349, 'mean_word_length': 4.253435114503817, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2716490', 'n_tokens_mistral': 897, 'n_tokens_neox': 829, 'n_words': 547}