-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
dataset locking and heartbeat #223
Conversation
Signed-off-by: John Davies <daviesja@uk.ibm.com>
Signed-off-by: John Davies <daviesja@uk.ibm.com>
Signed-off-by: John Davies <daviesja@uk.ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@John-A-Davies, please convert this into a draft.
@@ -0,0 +1,19 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this file?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I used this file a long time ago to try and launch some of the code in a VSCode debugger. I abandoned that, so I don't need the file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've deleted it.
build/build_env.sh
Outdated
@@ -12,7 +12,7 @@ set -e | |||
################################################################################ | |||
|
|||
|
|||
export _C89_LSYSLIB="CEE.SCEELKED:SYS1.CSSLIB:CSF.SCSFMOD0" | |||
export _C89_LSYSLIB="CEE.SCEELKED:SYS1.CSSLIB:PP.CSF.ZOS203.SCSFMOD0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this compatible with a typical LPAR?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's a local change that I needed on my test LPAR. I don't want that change to be pushed to git.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will revert line 15 to its original in Git. The build needs PP.CSF.ZOS203.SCSFMOD0
only on the target z/OS system.
c/datasetService.c
Outdated
char *l1 = stringListPrint(request->parsedFile, 1, 1, "/", 0); | ||
char *percentDecoded = cleanURLParamValue(response->slh, l1); | ||
char *filenamep1 = stringConcatenate(response->slh, "//'", percentDecoded); | ||
char *filename = stringConcatenate(response->slh, filenamep1, "'"); | ||
// char *datasetName = cleanURLParamValue(response->slh, l1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't keep commented out code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a work-in-progress
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
commented out code deleted
c/datasetService.c
Outdated
|
||
/* append PID to filename */ | ||
pid_t pid = getpid(); | ||
char pid_string[10]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use the style the rest of the code uses. That is, use camel case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
code deleted
@John-A-Davies you'll need to point the submodule to the zowe-common-c commit you'd like zss to use. When this is resolved the automation should build the branch. @jackjia-ibm can probably provide more info on that. |
File was for visual debugger but is no longer needed
Revert to repo value, keep local file which has changes to dataset names on my test system
changes only needed locally
remove local changes
remove local changes
Signed-off-by: John Davies <daviesja@uk.ibm.com>
Signed-off-by: John Davies <daviesja@uk.ibm.com>
Signed-off-by: John Davies <daviesja@uk.ibm.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments.
Additionally, a proper description of the pull-request is needed. The title isn't clear either. What does it mean?
build/build_env.sh
Outdated
@@ -1,57 +0,0 @@ | |||
#!/bin/sh |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file shouldn't have been removed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding it back now.
c/datasetService.c
Outdated
@@ -99,13 +99,16 @@ static int serveDatasetContents(HttpService *service, HttpResponse *response){ | |||
respondWithDataset(response, filename, TRUE); | |||
} | |||
else if (!strcmp(request->method, methodPOST)){ | |||
/* this section is WIP to allow saving of members when another user |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be part of the pull-request if it's WIP?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that comment came from me. That ELSE block AT LINE 101 contains the same code as staging
, apart from the comment, so I guess someone else removed the comment. I did add the EOL comments for my own interest on lines 106+107, but I made no other change to that ELSE block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think that comment came from me.
Al the commits in this pull-request belong to you. I don't see who else could have added this comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, you're right, the comment is mine. Now I remember. I added it as a placeholder to remind me that there was a problem to be fixed. So the comment refers to code I've not written yet.
The problem is, if a user has the PDS directory open, the POST code at line 101 won't work. This is because the POST accesses the dataset via USS. If you try it yourself at the USS command prompt, you will find that writing to a member of that PDS won't work while the directory is open.
I have a solution for this, but I've not had time to finalise it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hopefully removed extraneous comments
c/datasetService.c
Outdated
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Updating if exists: %s\n", filename); | ||
fflush(stdout); | ||
updateDataset(response, filename, TRUE); | ||
updateDataset(response, filename, TRUE); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't add trailing space.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's harmless in C. If there's a formatting standard, then we should have a code formatter to fix this sort of thing. Saves time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a change that does nothing. We shouldn't commit trailing spaces.
The rule of thumb is to use the same style as the rest of the file.
c/datasetService.c
Outdated
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG2, "begin %s\n", __FUNCTION__); | ||
|
||
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG2, "%s\n", __FUNCTION__); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why 2 almost identical calls?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed the 2nd one.
c/datasetService.c
Outdated
char *filenamep1 = stringConcatenate(response->slh, "//'", percentDecoded); | ||
char *filename = stringConcatenate(response->slh, filenamep1, "'"); | ||
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Taking enqueue on: %s\n", filename); | ||
fflush(stdout); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't need fflush
with zowelog
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Understood; I'll remove the 2 I added. There are another 6 instances in that C file. I'm happy to remove them too.
char *l1 = stringListPrint(request->parsedFile, 1, 1, "/", 0); | ||
char *percentDecoded = cleanURLParamValue(response->slh, l1); | ||
char *filenamep1 = stringConcatenate(response->slh, "//'", percentDecoded); | ||
char *filename = stringConcatenate(response->slh, filenamep1, "'"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can any of these be NULL?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting question and good spot of a potential error case.
These 4 lines are used by serveDatasetContents
, serveDatasetEnqueue
(my new function) and serveVSAMDatasetContents
, when the logic requires the DSN to be wrapped in the format //'dsn'
for use by USS. If either of my 2 usages of these 4 lines produces an error, then so could the other 4 uses in serveDatasetContents
and serveVSAMDatasetContents
.
This error can only happen with the API, since the file editor always ensures that the DSN is not null. I don't know if the API will catch that before it gets to this C program.
I'd like @struga0258 to create a test for this case. If that test fails, then I suggest we create a new issue and fix it at that stage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unchanged from original, need to review again, so far didnt encounter any error here, will ned to check edge cases like sending empty filename etc
c/datasetService.c
Outdated
@@ -194,6 +247,19 @@ void installDatasetContentsService(HttpServer *server) { | |||
registerHttpService(server, httpService); | |||
} | |||
|
|||
/* new */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bad comment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gone.
c/datasetService.c
Outdated
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_DEBUG, "Returning from %s\n", __FUNCTION__); | ||
return 0; | ||
} | ||
/* end of new for ENQ */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to comment obvious things.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gone.
c/zis/build.sh
Outdated
@@ -88,7 +88,7 @@ as "${ASFLAGS[@]}" -aegimrsx=nwm.asm nwm.s | |||
as "${ASFLAGS[@]}" -aegimrsx=secmgmt.asm secmgmt.s | |||
as "${ASFLAGS[@]}" -aegimrsx=snarfer.asm snarfer.s | |||
|
|||
export _LD_SYSLIB="//'SYS1.CSSLIB'://'CEE.SCEELKEX'://'CEE.SCEELKED'://'CEE.SCEERUN'://'CEE.SCEERUN2'://'CSF.SCSFMOD0'" | |||
export _LD_SYSLIB="//'SYS1.CSSLIB'://'CEE.SCEELKEX'://'CEE.SCEELKED'://'CEE.SCEERUN'://'CEE.SCEERUN2'://'PP.CSF.ZOS203.SCSFMOD0'" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't have been changed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right; it was for the local build. I will revert it.
c/zss.c
Outdated
@@ -666,6 +666,7 @@ static WebPluginListElt* readWebPluginDefinitions(HttpServer *server, ShortLived | |||
} | |||
int pluginLogLevel = checkLoggingVerbosity(serverConfigFile, identifier, slh); | |||
if (identifier && pluginLocation) { | |||
zowelog(NULL, LOG_COMP_ID_MVD_SERVER, ZOWE_LOG_WARNING, "Plugin ID '%s' is being loaded.\n", identifier); /* debug */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you still need this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Deleted.
@John-A-Davies, all the code changes (including cleanup) are supposed to be completed when a pull-request is open. Please convert it to a draft if you expect more work. |
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
refactor semaphore and address feedback
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Signed-off-by: Nakul Manchanda <nakul.manchanda@ibm.com>
Thank you all for your work on pessimistic locking approach to writing datasets. |
These changes provide support in the zss server for dataset edit with pessimistic locking. It calls ISGENQ in response to a new URI called /datasetEnqueue. The ENQ is held in a waiting process which ends when datasetEnqueue is called with the DELETE verb.