Skip to content
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

ZSS / ZLUX Editor: Write support for datasets #227

Closed
NolanRogers opened this issue Oct 7, 2019 · 8 comments
Closed

ZSS / ZLUX Editor: Write support for datasets #227

NolanRogers opened this issue Oct 7, 2019 · 8 comments
Assignees
Labels
app editor enhancement New feature or request Epic zss This issue has some dependency on zss
Milestone

Comments

@NolanRogers
Copy link

NolanRogers commented Oct 7, 2019

Members and non-vsam datasets need the ability to be saved like files in the editor. Locking is required.

ZSS handles dataset read/write locks improperly (not the same way ISPF 3.4 does).
E.g. a PDS member can't be saved if the PDS member list is viewed in ISPF.

Expected:
ZSS repeats ISPF 3.4 behaviour.

End user behavior is supposed to look closely to the file writing behavior

Some more research done in this regard:

  • optimistic locking approach

An optimistic locking approach:

  • fetch content, and calculate content hash
  • append content hash to response headers as e-tag
  • let user modify content
  • fetch and calculate content hash again, and compare it with e-tag of modified file
  • if same, grab lock , else throw error
  • replace content with modified content, and save
  • and free, lock

Need foundational **locking service ** to implement writing:

  • to lock a resource
  • to free/unlock a resource
  • to check if lock exists
  • to calculate or get content hash

RSE Dataset locking mechanism:
https://www.ibm.com/support/knowledgecenter/en/SSBDYH_3.2/com.ibm.zexpl.config.hostconfigref.doc/topics/dataset_lock_owner.html

@NakulManchanda
Copy link
Member

hi, we are going to revive this epic
Adding more stories

@NakulManchanda
Copy link
Member

NakulManchanda commented Jul 17, 2020

@NakulManchanda
Copy link
Member

@NakulManchanda NakulManchanda changed the title Write support for datasets in editor Write support for datasets Jul 17, 2020
@NakulManchanda NakulManchanda added the zss This issue has some dependency on zss label Jul 17, 2020
@NakulManchanda
Copy link
Member

NakulManchanda commented Jul 17, 2020

Explorer API Swagger:
Point to your zowe installation
https://mainframe.ibm.com:8547/swagger-ui.html -

Datasets API
image

Unix Files API
image

@NakulManchanda NakulManchanda changed the title Write support for datasets ZSS: Write support for datasets Jul 17, 2020
@NakulManchanda NakulManchanda changed the title ZSS: Write support for datasets ZSS / ZLUX Editor: Write support for datasets Jul 17, 2020
@NakulManchanda
Copy link
Member

We can start with following missing APIs

- Create
create pds - #498
create sequential - #498

  • create member

- Update
update member
update sequential

- Delete
Delete pds
Delete Sequential
Delete member

@1000TurquoisePogs
Copy link
Member

I think delete already exists, but probably doesn't do locking currently so it can be made better.
https://github.com/zowe/zss/blob/master/c/datasetService.c#L118

Write code does exist but is not exposed due to lack of locking, and I think there are some limitations in how we did it (dynalloc + LE's fread)... we may need to swap out LE file i/o libraries for lower-level functions.
https://github.com/zowe/zowe-common-c/blob/64577d0f01c0bf5472d89c3e24776688f8f8e0ac/c/datasetjson.c#L692

@1000TurquoisePogs
Copy link
Member

Status as we enter 21 PI2:

  • Can lock/unlock/write dataset, with a heartbeat

  • Semaphore logic has issues with being leftover when zss crashes, area of the code that uses semaphores might be able to be swapped for pthread_lock, otherwise a bigger refactor is needed

  • The number of threads = the number of datasets locked, but we could optimize by changing this to number of threads = number of users, which should be a lower number (refactor needed due to how sleep is factored - hard to add additional lock management to existing thread if it's sleeping)

  • automated test coverage does not track issues like left behind finite OS object like semaphores

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app editor enhancement New feature or request Epic zss This issue has some dependency on zss
Projects
None yet
Development

No branches or pull requests

6 participants