gfe-relnote: (n/a) Deprecate --gfe2_reloadable_flag_quic_track_ack_height_in_bandwidth_sampler2.

PiperOrigin-RevId: 273343146
Change-Id: I190868992578d41a3ab5764122ac2a15c3ddf723
diff --git a/quic/core/congestion_control/bbr_sender.cc b/quic/core/congestion_control/bbr_sender.cc
index ae1432a..b0fd50d 100644
--- a/quic/core/congestion_control/bbr_sender.cc
+++ b/quic/core/congestion_control/bbr_sender.cc
@@ -93,9 +93,6 @@
       sampler_(unacked_packets, kBandwidthWindowSize),
       round_trip_count_(0),
       max_bandwidth_(kBandwidthWindowSize, QuicBandwidth::Zero(), 0),
-      max_ack_height_(kBandwidthWindowSize, 0, 0),
-      aggregation_epoch_start_time_(QuicTime::Zero()),
-      aggregation_epoch_bytes_(0),
       min_rtt_(QuicTime::Delta::Zero()),
       min_rtt_timestamp_(QuicTime::Zero()),
       congestion_window_(initial_tcp_congestion_window * kDefaultTCPMSS),
@@ -175,12 +172,6 @@
     exiting_quiescence_ = true;
   }
 
-  if (!sampler_.quic_track_ack_height_in_bandwidth_sampler()) {
-    if (!aggregation_epoch_start_time_.IsInitialized()) {
-      aggregation_epoch_start_time_ = sent_time;
-    }
-  }
-
   sampler_.OnPacketSent(sent_time, packet_number, bytes, bytes_in_flight,
                         is_retransmittable);
 }
@@ -287,18 +278,10 @@
     startup_rate_reduction_multiplier_ = 2;
   }
   if (config.HasClientRequestedIndependentOption(kBBR4, perspective)) {
-    if (sampler_.quic_track_ack_height_in_bandwidth_sampler()) {
-      sampler_.SetMaxAckHeightTrackerWindowLength(2 * kBandwidthWindowSize);
-    } else {
-      max_ack_height_.SetWindowLength(2 * kBandwidthWindowSize);
-    }
+    sampler_.SetMaxAckHeightTrackerWindowLength(2 * kBandwidthWindowSize);
   }
   if (config.HasClientRequestedIndependentOption(kBBR5, perspective)) {
-    if (sampler_.quic_track_ack_height_in_bandwidth_sampler()) {
-      sampler_.SetMaxAckHeightTrackerWindowLength(4 * kBandwidthWindowSize);
-    } else {
-      max_ack_height_.SetWindowLength(4 * kBandwidthWindowSize);
-    }
+    sampler_.SetMaxAckHeightTrackerWindowLength(4 * kBandwidthWindowSize);
   }
   if (GetQuicReloadableFlag(quic_bbr_less_probe_rtt) &&
       config.HasClientRequestedIndependentOption(kBBR6, perspective)) {
@@ -413,13 +396,8 @@
     UpdateRecoveryState(last_acked_packet, !lost_packets.empty(),
                         is_round_start);
 
-    const QuicByteCount bytes_acked =
-        sampler_.total_bytes_acked() - total_bytes_acked_before;
-
-    excess_acked = sampler_.quic_track_ack_height_in_bandwidth_sampler()
-                       ? sampler_.OnAckEventEnd(max_bandwidth_.GetBest(),
-                                                round_trip_count_)
-                       : UpdateAckAggregationBytes(event_time, bytes_acked);
+    excess_acked =
+        sampler_.OnAckEventEnd(max_bandwidth_.GetBest(), round_trip_count_);
   }
 
   // Handle logic specific to PROBE_BW mode.
@@ -661,11 +639,7 @@
     rounds_without_bandwidth_gain_ = 0;
     if (expire_ack_aggregation_in_startup_) {
       // Expire old excess delivery measurements now that bandwidth increased.
-      if (sampler_.quic_track_ack_height_in_bandwidth_sampler()) {
-        sampler_.ResetMaxAckHeightTracker(0, round_trip_count_);
-      } else {
-        max_ack_height_.Reset(0, round_trip_count_);
-      }
+      sampler_.ResetMaxAckHeightTracker(0, round_trip_count_);
     }
     return;
   }
@@ -786,31 +760,6 @@
   }
 }
 
-// TODO(ianswett): Move this logic into BandwidthSampler.
-QuicByteCount BbrSender::UpdateAckAggregationBytes(
-    QuicTime ack_time,
-    QuicByteCount newly_acked_bytes) {
-  // Compute how many bytes are expected to be delivered, assuming max bandwidth
-  // is correct.
-  QuicByteCount expected_bytes_acked =
-      max_bandwidth_.GetBest() * (ack_time - aggregation_epoch_start_time_);
-  // Reset the current aggregation epoch as soon as the ack arrival rate is less
-  // than or equal to the max bandwidth.
-  if (aggregation_epoch_bytes_ <= expected_bytes_acked) {
-    // Reset to start measuring a new aggregation epoch.
-    aggregation_epoch_bytes_ = newly_acked_bytes;
-    aggregation_epoch_start_time_ = ack_time;
-    return 0;
-  }
-
-  // Compute how many extra bytes were delivered vs max bandwidth.
-  // Include the bytes most recently acknowledged to account for stretch acks.
-  aggregation_epoch_bytes_ += newly_acked_bytes;
-  max_ack_height_.Update(aggregation_epoch_bytes_ - expected_bytes_acked,
-                         round_trip_count_);
-  return aggregation_epoch_bytes_ - expected_bytes_acked;
-}
-
 void BbrSender::CalculatePacingRate() {
   if (BandwidthEstimate().IsZero()) {
     return;
@@ -865,9 +814,7 @@
       GetTargetCongestionWindow(congestion_window_gain_);
   if (is_at_full_bandwidth_) {
     // Add the max recently measured ack aggregation to CWND.
-    target_window += sampler_.quic_track_ack_height_in_bandwidth_sampler()
-                         ? sampler_.max_ack_height()
-                         : max_ack_height_.GetBest();
+    target_window += sampler_.max_ack_height();
   } else if (enable_ack_aggregation_during_startup_) {
     // Add the most recent excess acked.  Because CWND never decreases in
     // STARTUP, this will automatically create a very localized max filter.