3 Commits

Author SHA1 Message Date
Green Sky
866d64c7d8 send a bitset have all, if a local file is added
and minor fixes
2026-01-08 18:36:27 +01:00
Green Sky
254fe9c6d5 fix cmake version ranges 2026-01-06 18:10:03 +01:00
Green Sky
a647088218 fix out of order oscilation causing constant congestion events 2026-01-06 15:36:48 +01:00
9 changed files with 24 additions and 15 deletions

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.24 FATAL_ERROR)
cmake_minimum_required(VERSION 3.18...3.24 FATAL_ERROR)
add_subdirectory(./external)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
cmake_minimum_required(VERSION 3.18...3.24 FATAL_ERROR)
add_subdirectory(./sha1)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.8)
cmake_minimum_required(VERSION 3.18...3.24)
project(sha1 LANGUAGES C)

View File

@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.9...3.24 FATAL_ERROR)
cmake_minimum_required(VERSION 3.18...3.24 FATAL_ERROR)
########################################

View File

@@ -168,13 +168,15 @@ void FlowOnly::onAck(std::vector<SeqIDType> seqs) {
});
if (it != _in_flight.end() && !it->ignore) {
// find first non ignore, it should be the expected
auto first_it = std::find_if_not(_in_flight.cbegin(), _in_flight.cend(), [](const auto& v) -> bool { return v.ignore; });
auto first_it = std::find_if_not(_in_flight.begin(), _in_flight.end(), [](const auto& v) -> bool { return v.ignore; });
if (first_it != _in_flight.cend() && it != first_it && !it->ignore) {
if (first_it != _in_flight.cend() && it != first_it && !first_it->ignore) {
// not next expected seq -> skip detected
_consecutive_events++;
it->ignore = true; // only handle once
// only handle once
it->ignore = true;
first_it->ignore = true;
updateCongestion();
} else {

View File

@@ -89,7 +89,7 @@ void SHA1MappedFilesystem::newFromFile(std::string_view file_name, std::string_v
sha1_info.file_size = file_impl->_file_size; // TODO: remove the reliance on implementation details
sha1_info.chunk_size = chunkSizeFromFileSize(sha1_info.file_size);
{
// TOOD: remove
// TODO: remove
const uint32_t cs_low {32*1024};
const uint32_t cs_high {4*1024*1024};

View File

@@ -11,7 +11,6 @@
#include <entt/container/dense_map.hpp>
#include "./ft1_sha1_info.hpp"
#include "./hash_utils.hpp"
#include <vector>
#include <deque>

View File

@@ -3,7 +3,7 @@
#include "./contact_components.hpp"
#include "./chunk_picker.hpp"
#include <iostream>
//#include <iostream>
bool addParticipation(ContactHandle4 c, ObjectHandle o) {
bool was_new {false};

View File

@@ -517,15 +517,23 @@ void SHA1_NGCFT1::onSendFileHashFinished(ObjectHandle o, Message3Registry* reg_p
// TODO: we dont want chunks anymore
// TODO: make sure to abort every receiving transfer (sending info and chunk should be fine, info uses copy and chunk handle)
// something happend, update all chunk pickers
// queue a send bitset (have all) to all participants
if (o.all_of<Components::SuspectedParticipants>()) {
for (const auto& pcv : o.get<Components::SuspectedParticipants>().participants) {
ContactHandle4 pch = _cs.contactHandle(pcv);
assert(static_cast<bool>(pch));
pch.emplace_or_replace<ChunkPickerUpdateTag>();
for (const auto cv : o.get<Components::SuspectedParticipants>().participants) {
queueBitsetSendFull(_cs.contactHandle(cv), o);
}
}
// something happend, update all chunk pickers
// wtf why, we now have the full file, no? why update the receiving
//if (o.all_of<Components::SuspectedParticipants>()) {
// for (const auto& pcv : o.get<Components::SuspectedParticipants>().participants) {
// ContactHandle4 pch = _cs.contactHandle(pcv);
// assert(static_cast<bool>(pch));
// pch.emplace_or_replace<ChunkPickerUpdateTag>();
// }
//}
// in both cases, private and public, c (contact to) is the target
o.get_or_emplace<Components::AnnounceTargets>().targets.emplace(c);