2
2
3
3
namespace NKikimr ::NOlap::NStorageOptimizer::NLCBuckets {
4
4
5
- void TOneLayerPortions::DoModifyPortions (const std::vector<TPortionInfo::TPtr>& add, const std::vector<TPortionInfo::TPtr>& remove) {
5
+ std::vector<TPortionInfo::TPtr> TOneLayerPortions::DoModifyPortions (
6
+ const std::vector<TPortionInfo::TPtr>& add, const std::vector<TPortionInfo::TPtr>& remove) {
7
+ std::vector<TPortionInfo::TPtr> problems;
6
8
for (auto && i : remove) {
7
9
auto it = Portions.find (TOrderedPortion (i));
8
10
AFL_VERIFY (it != Portions.end ());
@@ -18,26 +20,34 @@ void TOneLayerPortions::DoModifyPortions(const std::vector<TPortionInfo::TPtr>&
18
20
{
19
21
auto it = info.first ;
20
22
++it;
21
- if (it != Portions.end ()) {
22
- AFL_VERIFY (i->IndexKeyEnd () < it->GetStart ())(" start" , i->IndexKeyStart ().DebugString ())(" end" , i->IndexKeyEnd ().DebugString ())(
23
- " next" , it->GetStart ().DebugString ())(" next1" , it->GetStart ().DebugString ())(
24
- " next2" , it->GetPortion ()->IndexKeyEnd ().DebugString ())(" level_id" , GetLevelId ())(
25
- " portion_id_new" , i->GetPortionId ())(" portion_id_old" , it->GetPortion ()->GetPortionId ())(
26
- " portion_old" , it->GetPortion ()->DebugString ())(" add" , sb);
23
+ if (it != Portions.end () && it->GetStart () <= i->IndexKeyEnd ()) {
24
+ AFL_ERROR (NKikimrServices::TX_COLUMNSHARD_COMPACTION)(" start" , i->IndexKeyStart ().DebugString ())(
25
+ " end" , i->IndexKeyEnd ().DebugString ())(" next" , it->GetStart ().DebugString ())(" next1" , it->GetStart ().DebugString ())(
26
+ " next2" , it->GetPortion ()->IndexKeyEnd ().DebugString ())(" level_id" , GetLevelId ())(" portion_id_new" , i->GetPortionId ())(
27
+ " portion_id_old" , it->GetPortion ()->GetPortionId ())(" portion_old" , it->GetPortion ()->DebugString ())(" add" , sb);
28
+ problems.emplace_back (i);
29
+ Portions.erase (info.first );
30
+ continue ;
27
31
}
28
32
}
29
33
{
30
34
auto it = info.first ;
31
35
if (it != Portions.begin ()) {
32
36
--it;
33
- AFL_VERIFY (it->GetPortion ()->IndexKeyEnd () < i->IndexKeyStart ())
34
- (" start" , i->IndexKeyStart ().DebugString ())(" finish" , i->IndexKeyEnd ().DebugString ())(" pred_start" ,
35
- it->GetPortion ()->IndexKeyStart ().DebugString ())(" pred_finish" , it->GetPortion ()->IndexKeyEnd ().DebugString ())(" level_id" , GetLevelId ())(
36
- " portion_id_new" , i->GetPortionId ())(" portion_id_old" , it->GetPortion ()->GetPortionId ())(" add" , sb);
37
+ if (i->IndexKeyStart () <= it->GetPortion ()->IndexKeyEnd ()) {
38
+ AFL_ERROR (NKikimrServices::TX_COLUMNSHARD_COMPACTION)(" start" , i->IndexKeyStart ().DebugString ())(
39
+ " finish" , i->IndexKeyEnd ().DebugString ())(" pred_start" , it->GetPortion ()->IndexKeyStart ().DebugString ())(
40
+ " pred_finish" , it->GetPortion ()->IndexKeyEnd ().DebugString ())(" level_id" , GetLevelId ())(
41
+ " portion_id_new" , i->GetPortionId ())(" portion_id_old" , it->GetPortion ()->GetPortionId ())(" add" , sb);
42
+ problems.emplace_back (i);
43
+ Portions.erase (info.first );
44
+ continue ;
45
+ }
37
46
}
38
47
}
39
48
}
40
49
}
50
+ return problems;
41
51
}
42
52
43
53
TCompactionTaskData TOneLayerPortions::DoGetOptimizationTask () const {
@@ -69,4 +79,4 @@ TCompactionTaskData TOneLayerPortions::DoGetOptimizationTask() const {
69
79
return result;
70
80
}
71
81
72
- }
82
+ } // namespace NKikimr::NOlap::NStorageOptimizer::NLCBuckets
0 commit comments