[jira] [Updated] (HIVE-27564) Add log for ZooKeeperTokenStore

2023-08-03 Thread lvyanquan (Jira)


 [ 
https://issues.apache.org/jira/browse/HIVE-27564?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

lvyanquan updated HIVE-27564:
-
Description: 
when use zookeeper to store DelegationTokenIdentifier,  we use 
{code:java}
TokenStoreDelegationTokenSecretManager.encodeWritable(tokenIdentifier) {code}
to encode message of tokens and create the path in zookeeper, like picture1.png

However, when this token was removed, error message will display 
DelegationTokenIdentifier only, then we have no idea about whether this path is 
still existed and when the path in zookeeper was created and deleted.
{code:java}
public byte[] retrievePassword(DelegationTokenIdentifier identifier) throws 
InvalidToken {
DelegationTokenInformation info = this.tokenStore.getToken(identifier);
if (info == null) {
throw new InvalidToken("token expired or does not exist: " + 
identifier);
}
// must reuse super as info.getPassword is not accessible
synchronized (this) {
  try {
super.currentTokens.put(identifier, info);
return super.retrievePassword(identifier);
  } finally {
super.currentTokens.remove(identifier);
  }
}
} {code}
So, I try to add so log about the lifecycle of the tokenPath.

  was:
when use zookeeper to store DelegationTokenIdentifier,  we use 
{code:java}
TokenStoreDelegationTokenSecretManager.encodeWritable(tokenIdentifier) {code}
to encode message of tokens, like picture1.png

However, when this token was removed, error message will display 
DelegationTokenIdentifier only, then we have no idea about whether this path is 
still existed and when the path in zookeeper was created and deleted.

{code:java}
public byte[] retrievePassword(DelegationTokenIdentifier identifier) throws 
InvalidToken {
DelegationTokenInformation info = this.tokenStore.getToken(identifier);
if (info == null) {
throw new InvalidToken("token expired or does not exist: " + 
identifier);
}
// must reuse super as info.getPassword is not accessible
synchronized (this) {
  try {
super.currentTokens.put(identifier, info);
return super.retrievePassword(identifier);
  } finally {
super.currentTokens.remove(identifier);
  }
}
} {code}
So, I try to add so log about the lifecycle of the tokenPath.


> Add log for ZooKeeperTokenStore
> ---
>
> Key: HIVE-27564
> URL: https://issues.apache.org/jira/browse/HIVE-27564
> Project: Hive
>  Issue Type: Improvement
>Reporter: lvyanquan
>Assignee: lvyanquan
>Priority: Major
> Attachments: picture 1.png
>
>
> when use zookeeper to store DelegationTokenIdentifier,  we use 
> {code:java}
> TokenStoreDelegationTokenSecretManager.encodeWritable(tokenIdentifier) {code}
> to encode message of tokens and create the path in zookeeper, like 
> picture1.png
> However, when this token was removed, error message will display 
> DelegationTokenIdentifier only, then we have no idea about whether this path 
> is still existed and when the path in zookeeper was created and deleted.
> {code:java}
> public byte[] retrievePassword(DelegationTokenIdentifier identifier) throws 
> InvalidToken {
> DelegationTokenInformation info = this.tokenStore.getToken(identifier);
> if (info == null) {
> throw new InvalidToken("token expired or does not exist: " + 
> identifier);
> }
> // must reuse super as info.getPassword is not accessible
> synchronized (this) {
>   try {
> super.currentTokens.put(identifier, info);
> return super.retrievePassword(identifier);
>   } finally {
> super.currentTokens.remove(identifier);
>   }
> }
> } {code}
> So, I try to add so log about the lifecycle of the tokenPath.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)


[jira] [Created] (HIVE-27564) Add log for ZooKeeperTokenStore

2023-08-03 Thread lvyanquan (Jira)
lvyanquan created HIVE-27564:


 Summary: Add log for ZooKeeperTokenStore
 Key: HIVE-27564
 URL: https://issues.apache.org/jira/browse/HIVE-27564
 Project: Hive
  Issue Type: Improvement
Reporter: lvyanquan
Assignee: lvyanquan
 Attachments: picture 1.png

when use zookeeper to store DelegationTokenIdentifier,  we use 
{code:java}
TokenStoreDelegationTokenSecretManager.encodeWritable(tokenIdentifier) {code}
to encode message of tokens, like picture1.png

However, when this token was removed, error message will display 
DelegationTokenIdentifier only, then we have no idea about whether this path is 
still existed and when the path in zookeeper was created and deleted.

{code:java}
public byte[] retrievePassword(DelegationTokenIdentifier identifier) throws 
InvalidToken {
DelegationTokenInformation info = this.tokenStore.getToken(identifier);
if (info == null) {
throw new InvalidToken("token expired or does not exist: " + 
identifier);
}
// must reuse super as info.getPassword is not accessible
synchronized (this) {
  try {
super.currentTokens.put(identifier, info);
return super.retrievePassword(identifier);
  } finally {
super.currentTokens.remove(identifier);
  }
}
} {code}
So, I try to add so log about the lifecycle of the tokenPath.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)