One practical solution to this is to cache the SF value after share
refreshes and provide that cached value once, when the getter called
from the next ADC info sending. This may need a special getter for this
purpose.

Since we always send an INF right after share refreshes and already got
a nice resource holder facility for pause hashing, I choose to use that
to block hashing until the INFs has been sent out. This choice is less
code and needs no API or other significant changes.

Both solutions require the logic of how DC++'s share refresh works :
during refresh, it removes both missing and _modified_ items from the in
memory share indices. So these solutions pick and use SF's value right
after the refreshing.

Other clients may behave otherwise on refreshing so these solutions may
not (entirely) apply to them.

Bloom filters are very useful tool for hub bandwidth management, especially on 
hubs running on asymmetric connections. According to people running large 
(NMDC) hubs, this is still a big problem these days, even when using fast, high 
bandwidth connections.
But there could be also people e.g. in undeveloped countries with slow / mobile 
connections who'd like to take advantage on this. ADCH++ can be easily run to 
serve 100's of users fine on devices like an old RPI, router or even a mobile 
phone...

** Changed in: dcplusplus
       Status: Confirmed => Fix Committed

-- 
You received this bug notification because you are a member of
Dcplusplus-team, which is subscribed to DC++.
https://bugs.launchpad.net/bugs/2110291

Title:
  One time small updates in the share may not trigger a Bloom filter
  update request which makes such updated files unsearchable by TTH for
  other hub users

Status in ADCH++:
  Fix Released
Status in AirDC++:
  New
Status in DC++:
  Fix Committed

Bug description:
  There is a possible scenario where other users logged into the same ADCH++ 
hub with Bloom filter support
  may not receive search results (by TTH) for one or more updated files after 
manually refreshing the share in DC++, until the user updates the share once 
more or reconnects to the hub.

  The problem is consistently reproducible after one or a few files getting 
updated and the sharre refreshed,
  if the overall size of the changed files is relatively small.

  To reproduce this, you need to update already shared file(s) with different 
content,
  or perform a similar number of file removals and additions to the share, then 
manually refresh the share.

  The cause of the issue is that sending INFs — just like any other commands — 
is not instantaneous.
  The function that compiles the INF command is placed into the async task 
queue of all connected hubs' sockets, to be run when feasible.
  If, for example, you update one small file and refresh the share, normally 
that would result in sending SF = lastSF - 1 with the infoupdate() right after 
the refresh.
  Then, the hashing thread's TTHDone event handler updates the total number of 
files after the file with the updated content has been hashed.
  This change is then sent with the next scheduled infoupdate() (typically 
minutely).

  But... if the small updated file is already hashed by the time the hub's 
respective infoupdate() is called,
  then SF becomes lastSF + 1 again. Bingo — the value is correct, but the Bloom 
plugin won't be signaled to request a filter update.
  OTOH if the hasher's queue is empty before the share refresh, it will indeed 
start working almost instantaneously, so if the total size of the updated 
file(s) is small enough, it often wins the race, it seems.

  The largest total updated file size to reproduce this depends on your 
hardware.
  It is higher with faster CPUs and storage, and also depends on how busy the 
hub/socket is at the time.

  On a system with a 100Mb/s HDD read speed and an i5-6600 CPU, the threshold 
is about 15 MiB.
  Obviously, this could easily be 10 times larger on modern hardware.

To manage notifications about this bug go to:
https://bugs.launchpad.net/adchpp/+bug/2110291/+subscriptions


_______________________________________________
Mailing list: https://launchpad.net/~linuxdcpp-team
Post to     : linuxdcpp-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~linuxdcpp-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to