Copilot commented on code in PR #7059:
URL: https://github.com/apache/hbase/pull/7059#discussion_r2123172794
##########
hbase-server/src/main/java/org/apache/hadoop/hbase/master/snapshot/SnapshotManager.java:
##########
@@ -726,12 +726,27 @@ private synchronized long
submitSnapshotProcedure(SnapshotDescription snapshot,
.submitProcedure(new MasterProcedureUtil.NonceProcedureRunnable(master,
nonceGroup, nonce) {
@Override
protected void run() throws IOException {
+ TableDescriptor tableDescriptor =
+
master.getTableDescriptors().get(TableName.valueOf(snapshot.getTable()));
+ MasterCoprocessorHost cpHost =
getMaster().getMasterCoprocessorHost();
+ User user = RpcServer.getRequestUser().orElse(null);
+ org.apache.hadoop.hbase.client.SnapshotDescription snapshotDesc =
+ ProtobufUtil.createSnapshotDesc(snapshot);
+
+ if (cpHost != null) {
+ cpHost.preSnapshot(snapshotDesc, tableDescriptor, user);
Review Comment:
Consider wrapping the preSnapshot hook call in a try-catch block or ensuring
that any exceptions it may throw are appropriately handled, so that a failure
in the coprocessor does not disrupt the snapshot procedure submission.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]