Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

Commit ca3bd75

Browse files
authored
Merge branch 'main' into postprocessor
2 parents b50d888 + 45905a0 commit ca3bd75

18 files changed

Lines changed: 895 additions & 120 deletions

File tree

.github/workflows/hermetic_library_generation.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
with:
3838
fetch-depth: 0
3939
token: ${{ secrets.CLOUD_JAVA_BOT_TOKEN }}
40-
- uses: googleapis/google-cloud-java/sdk-platform-java/.github/scripts@v1.85.0
40+
- uses: googleapis/google-cloud-java/sdk-platform-java/.github/scripts@google-cloud-shared-dependencies/v3.61.0
4141
if: env.SHOULD_RUN == 'true'
4242
with:
4343
image_tag: latest

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ If you are using Maven without the BOM, add this to your dependencies:
4949
If you are using Gradle 5.x or later, add this to your dependencies:
5050

5151
```Groovy
52-
implementation platform('com.google.cloud:libraries-bom:26.79.0')
52+
implementation platform('com.google.cloud:libraries-bom:26.80.0')
5353
5454
implementation 'com.google.cloud:google-cloud-bigtable'
5555
```

generation_config.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
gapic_generator_version: 2.69.0
2-
googleapis_commitish: 9a832ccde3f3ca4d4e1c39593b1cbf9aa62a75b3
3-
libraries_bom_version: 26.79.0
1+
gapic_generator_version: 2.71.0
2+
googleapis_commitish: 939ba3bf8408af83f0f73ae35c76c4b11a8c8c8d
3+
libraries_bom_version: 26.80.0
44
template_excludes:
55
- .gitignore
66
- .kokoro/presubmit/integration.cfg

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/channels/ChannelPoolDpImpl.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -262,11 +262,16 @@ private void removeGroup(AfeChannelGroup group) {
262262
}
263263

264264
@GuardedBy("this")
265-
private AfeChannelGroup rehomeChannel(ChannelWrapper channelWrapper, AfeId afeId) {
265+
private void rehomeChannel(ChannelWrapper channelWrapper, AfeId afeId) {
266+
// No need to rehome recycled channels.
267+
if (channelWrapper.channel.isShutdown()) {
268+
return;
269+
}
270+
266271
AfeChannelGroup origGroup = channelWrapper.group;
267272

268273
if (Objects.equals(origGroup.afeId, afeId)) {
269-
return origGroup;
274+
return;
270275
}
271276

272277
log(Level.FINE, "Rehoming channel from: %s to %s", origGroup.afeId, afeId);
@@ -291,7 +296,7 @@ private AfeChannelGroup rehomeChannel(ChannelWrapper channelWrapper, AfeId afeId
291296
newGroup.channels.add(channelWrapper);
292297
newGroup.numStreams += channelWrapper.numOutstanding;
293298

294-
return newGroup;
299+
return;
295300
}
296301

297302
// Update accounting when a stream is closed and releases its channel
@@ -322,6 +327,11 @@ private static boolean shouldRecycleChannel(Status status) {
322327

323328
@GuardedBy("this")
324329
private void recycleChannel(ChannelWrapper channelWrapper) {
330+
if (channelWrapper.channel.isShutdown()) {
331+
// Channel is already recycled.
332+
return;
333+
}
334+
325335
channelWrapper.group.channels.remove(channelWrapper);
326336
channelWrapper.channel.shutdown();
327337
// Checking for starting group because we don't want to delete the stating group.

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ VRpc<ReqT, RespT> newCall(VRpcDescriptor<OpenReqT, ReqT, RespT> descriptor) {
324324

325325
long rpcId = nextRpcId;
326326
nextRpcId = Math.incrementExact(nextRpcId);
327-
return new VRpcImpl<>(this, descriptor, rpcId, stream.getPeerInfo());
327+
return new VRpcImpl<>(this, descriptor, rpcId, stream.getPeerInfo(), debugTagTracer);
328328
}
329329
}
330330

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionList.java

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ public Optional<SessionHandle> checkoutSession(AfeHandle afeHandle) {
111111
handle -> {
112112
poolStats.readyCount--;
113113
poolStats.inUseCount++;
114-
114+
inUseSessions.add(handle);
115115
if (handle.afe.get().sessions.isEmpty()) {
116116
afesWithReadySessions.remove(afeHandle);
117117
}
@@ -194,11 +194,6 @@ void onSessionStarted() {
194194
poolStats.readyCount++;
195195
}
196196

197-
void onVRpcStarted() {
198-
// Pool stats and AFE list are updated in SessionList#checkoutSession
199-
inUseSessions.add(this);
200-
}
201-
202197
/**
203198
* The session is returned to the pool after use. This undoes what SessionList#checkoutSession
204199
*/

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/SessionPoolImpl.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -534,7 +534,6 @@ private void tryDrainPendingRpcs() {
534534
if (!handle.isPresent()) {
535535
break;
536536
}
537-
handle.get().onVRpcStarted();
538537
PendingVRpc<?, ?> rpc = pendingRpcs.removeFirst();
539538
rpc.drainTo(handle.get());
540539
}

google-cloud-bigtable/src/main/java/com/google/cloud/bigtable/data/v2/internal/session/VRpcImpl.java

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import com.google.bigtable.v2.VirtualRpcRequest;
2121
import com.google.bigtable.v2.VirtualRpcRequest.Metadata;
2222
import com.google.bigtable.v2.VirtualRpcResponse;
23+
import com.google.cloud.bigtable.data.v2.internal.csm.tracers.DebugTagTracer;
2324
import com.google.cloud.bigtable.data.v2.internal.middleware.VRpc;
2425
import com.google.protobuf.Message;
2526
import com.google.protobuf.MessageLite;
@@ -72,16 +73,20 @@ private enum State {
7273

7374
private AtomicReference<State> state;
7475

76+
private final DebugTagTracer debugTagTracer;
77+
7578
public VRpcImpl(
7679
VRpcSessionApi session,
7780
VRpcDescriptor<OpenReqT, ReqT, RespT> desc,
7881
long rpcId,
79-
PeerInfo peerInfo) {
82+
PeerInfo peerInfo,
83+
DebugTagTracer debugTagTracer) {
8084
this.session = session;
8185
this.desc = desc;
8286
this.rpcId = rpcId;
8387
this.state = new AtomicReference<>(State.NEW);
8488
this.peerInfo = peerInfo;
89+
this.debugTagTracer = debugTagTracer;
8590
}
8691

8792
@Override
@@ -96,6 +101,8 @@ public void start(ReqT req, VRpcCallContext ctx, VRpcListener<RespT> listener) {
96101
retryable = false;
97102
} else if (ctx.getOperationInfo().getDeadline().timeRemaining(TimeUnit.MICROSECONDS)
98103
< TimeUnit.MILLISECONDS.toMicros(1)) {
104+
// transitioning to the close state is handled below
105+
state.set(State.STARTED);
99106
// Don't send RPCs that don't have any hope of succeeding
100107
status =
101108
Status.DEADLINE_EXCEEDED.withDescription("Remaining deadline is too short to send RPC");
@@ -124,9 +131,11 @@ public void start(ReqT req, VRpcCallContext ctx, VRpcListener<RespT> listener) {
124131
}
125132

126133
if (!status.isOk()) {
127-
if (!state.compareAndSet(State.STARTED, State.CLOSED)) {
128-
return;
129-
}
134+
debugTagTracer.checkPrecondition(
135+
state.compareAndSet(State.STARTED, State.CLOSED),
136+
"vrpc_incorrect_start_state",
137+
"VRpc has incorrect state. Expected to be started but was %s",
138+
state);
130139
// TODO: loop through the session executor
131140
if (retryable) {
132141
listener.onClose(VRpcResult.createUncommitedError(status));

google-cloud-bigtable/src/main/resources/META-INF/native-image/com.google.cloud.bigtable.admin.v2/reflect-config.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1871,6 +1871,15 @@
18711871
"allDeclaredClasses": true,
18721872
"allPublicClasses": true
18731873
},
1874+
{
1875+
"name": "com.google.bigtable.admin.v2.Instance$Edition",
1876+
"queryAllDeclaredConstructors": true,
1877+
"queryAllPublicConstructors": true,
1878+
"queryAllDeclaredMethods": true,
1879+
"allPublicMethods": true,
1880+
"allDeclaredClasses": true,
1881+
"allPublicClasses": true
1882+
},
18741883
{
18751884
"name": "com.google.bigtable.admin.v2.Instance$State",
18761885
"queryAllDeclaredConstructors": true,

google-cloud-bigtable/src/test/java/com/google/cloud/bigtable/admin/v2/BaseBigtableInstanceAdminClientTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -475,6 +475,7 @@ public void updateInstanceTest() throws Exception {
475475
Assert.assertEquals(request.getDisplayName(), actualRequest.getDisplayName());
476476
Assert.assertEquals(request.getState(), actualRequest.getState());
477477
Assert.assertEquals(request.getType(), actualRequest.getType());
478+
Assert.assertEquals(request.getEdition(), actualRequest.getEdition());
478479
Assert.assertEquals(request.getLabelsMap(), actualRequest.getLabelsMap());
479480
Assert.assertEquals(request.getCreateTime(), actualRequest.getCreateTime());
480481
Assert.assertEquals(request.getSatisfiesPzs(), actualRequest.getSatisfiesPzs());

0 commit comments

Comments
 (0)